Opened 11 years ago

Closed 11 years ago

#292 closed defect (fixed)

Investigate threading issue in libtrace IO

Reported by: salcock Owned by: salcock
Priority: major Milestone: libtrace3
Component: libtrace-library Version:
Keywords: Cc:


If the change in r1681 is reverted, libtrace can segfault when reading traces on certain systems.

This appears to be due to a threading issue where the value of the len parameter passed into thread_read() is changed by another thread. This is in spite of the parameter being passed in by value rather than reference, as gcc appears to be optimising this parameter into a pass by reference. Disabling optimisations will prevent the problem from occurring.

The solution in r1681 is only treating the symptom, not the actual problem, so it would be good if we can find the point where the other thread touches something it shouldn't and put a mutex around it.

I've been able to replicate this on an Ubuntu 9.10 box using gcc 4.4.1 (for WAND folks, this is laptop "druid").

Change History (1)

comment:1 Changed 11 years ago by salcock

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r1685 - turned out to be an issue with the size of off_t changing between function calls.

Note: See TracTickets for help on using tickets.