GC weirdness resolved.

Bryce Kampjes bryce at kampjes.demon.co.uk
Thu Apr 8 20:12:50 UTC 2004


I found and fixed my bug. It was in my code, and not related
to garbage collection.

The fix was to move my hook before the call to check interrupts
at the bottom of Interpreter>>internalExecuteNewMethod.

What was happening for this one test was an interrupt was being
triggered that switched processes. Then my code was called that
used a value looked up from the methodCache to call compiled
machine code. In this case it used the new processes context to
run code meant for a different context which corrupted memory.

The compiled code assumes that the receiver is correct. In this
case it's an arbitrary class so setting it's instance variables
leads to corruption. 

That it was an interrupt triggering explains why switching
optimisation on and off can, depending on CPU speed, make the bug
appear and disappear. It also explains why my previous false fixes
removed the symptoms, they just slowed down execution which stopped
this specific interrupt check triggering. This check is the first one
after a full garbage collect which I trigger to force some objects
into old space so I can check that my rootTable updating works. The
full garbage collect is slow which means the next send afterwards is
very likely interrupt.

Bryce



More information about the Squeak-dev mailing list