Skip to content

ReferenceStream does not rehash HashedCollections during read, which leads to corrupt dictionaries (Solution included) #113

Open
@unique75m

Description

@unique75m

If you file out dictionaries with the ReferenceStream protocol, restart the image and read the dictionaries back into image from file, then it could be that the hashed keys inside the dictionary are not valid anymore. In my case I have an IdentityDictionary, where the keys are symbols. If this dictionary is read back, then I can see in the Explore-Inspector, that it is corrupted. If I add the same symbol key again, then it is added under a new hash index and added twice, which leads to much more trouble in later computations. I have researched that issue now and I guess there is a simple #rehash missing in method

Object >> readDataFrom:size:

I simply added a "self rehash" before the last return statement and everything works fine now for me.
I have tested this with Squeak 6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions