RACE CONDITION!!!!!

Bryce Kampjes bryce at kampjes.demon.co.uk
Thu Apr 1 22:00:25 UTC 2004


Yoshiki Ohshima writes:
 >   It could be that your memcpy equivalent is wrong?  For example, if
 > the compaction phase, or any phase, of the garbage collection, is not
 > doing correct thing, or object creation doesn't do nil-out, etc.,
 > etc. can cause this kind of errors.

Alan, 
It does sound like a memory corruption bug. I've had a few
non-deterministic bugs that didn't need race conditions.

My favourite way to create them is to iterate over a dictionary.
Then, accidentally, create a bug that only occurs for some iteration
orderings. This is very easy to do when writing program analyses where
the data structures involve either Sets or Dictionaries.

Try Andreas's trick of setting the incremental collector to run every
garbage collect. The "Smalltalk vmParameterAt: 5 put: 1" which will
make some garbage collector problems more obvious.

If that doesn't work, one thing I'm currently doing is writing a
memory checker. The garbage collector's sweep walks over all the
objects in memory, that loop can be used to check that memory hasn't
been corrupted.

Memory corruption bugs are much messier when there is a garbage
collector moving objects around.

Bryce



More information about the Squeak-dev mailing list