----- Forwarded Message -----
From: Chris Muller <[hidden email]>
To: Avi Bryant <[hidden email]>
Sent: Tuesday, April 5, 2005 3:35 PM
Subject: Significant WriteBarrier bug, assistance needed
Hi, I know you just helped me with one bug but now I've run into a tougher one.
I thought I had it nailed, I think my fix is close but there is still one
problem which I can't seem to fix.
Here's the problem. Given this class-hierarchy:
and instances of WbTestB are behind write-barrier, if then inst-vars are added
to WbTestA, the current implementation tries to migrate (e.g., in
WBClassBuider>>migrateFromTarget:to:) based on what comes in from the
SystemChangeEvent, which is the WbTestA changes. It ends up creating a new
write-barrier subclass for WbTestA and assigning that to the 'class' variable
of the builder for WbTestB. A primitive failure soon results.
Based on my research, it seems, under this case, no migration of old WbTestB
instances should be necessary because class WbTestB will, by the time it gets
to WBClassBuider>>migrateFromTarget:to:, already be pointing to the new WbTestA
superclass, not the old one. So my fix so far involves changing that method
migrateFromTarget: oldSuperclass to: newSuperclass
| oldClass |
oldClass _ class.
"Was the immediate WriteBarrier superclass modified (or was it a
(oldClass superclass == newSuperclass)
[ oldClass superclass: oldSuperclass.
class _ self createSubclassOf: newSuperclass.
class updateInstancesFrom: oldClass ]
To test this, I created these two test scripts. The first as a regression-test
for changing the immediate superclass, the second to handle the new scenario I
[ wb remove: domain.
a removeFromSystem ]
So, what's the problem now? The first test still works, the second "works"
until it tries to clean up. The line in the ensure block:
wb remove: domain
gets a primitive failure in primitiveChangeClassTo: and I can't figure out why.
The commment is very detailed about the possible reasons but I still think
we're not violating any of those reasons, it should work..
I stared at it until 1am, but I'm just not seeing it.. Can you give me a hand?