Hi
Fuel kept throwing strange errors at me the last couple of days. I now found
that IdentitySet>>size is not correct for some instances in the image and can’t
be fixed with #rehash (checked with newest image on newest PharoVM).
I noticed that #rehash only replaces ‘array' while ‘tally’ stays untouched (but
‘tally’ holds the wrong size…).
Notice that all those instances seem to be related to tests (their elements are
all Metaclass objects of test classes).
Here’s how to get the (16) corrupted instances:
IdentitySet allInstances select: [ :e | e size ~= (e collect:
#yourself) size ]
Why this causes problems for Fuel:
During serialization the IdentitySet size is stored and later its objects.
During that step, #do: will evaluate the block less often than it should, based
on size (e.g. size is 3, but ‘array’ only holds 2 objects).
During materialization all the offsets after an IdentitySet object in the
stream are off because of this.
FogBugz issue:
https://pharo.fogbugz.com/f/cases/13026/IdentitySet-size-reports-wrong-size
Cheers,
Max