Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
unique75m opened this issue Jan 24, 2024 · 0 comments

Comments

@unique75m
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant