On Thu, Feb 18, 2010 at 10:19:20PM +0100, Philipp Kern wrote: > Ok, it also failed on a multi-CPU builder on i386. Further tracing suggests > that there's something in libwibble's mutex code it doesn't like. When I > replace the locking in util/runner.cc with boost::mutex, > boost::mutex::scoped_lock and boost::condition it works just fine in my > limited testing so far (i.e. running the tests, not guessnet itself).
It wasn't libwibble in the end, it was just a race condition: the ProcessRunner destructor would not wait for the thread to end, so it might happen that the thread was still running after destruction, accessing deallocated memory. valgrind really helped here, pointing out the freed memory access. Also, I gave a try to valgrind --tool=helgrind, which helpfully found another race condition (harmless, and only present in the tests; nevertheless, I fixed it). Ciao, Enrico -- GPG key: 4096R/E7AD5568 2009-05-08 Enrico Zini <[email protected]>
signature.asc
Description: Digital signature

