[squeak-dev] MapCache in DebuggerMethodMap corrupted

Marcel Taeumel marcel.taeumel at hpi.de
Wed Dec 8 14:43:05 UTC 2021


So, the key here is a compiled method (no longer installed), whose #scaledIdentityHash cannot be used to compute the index in the WeakIdentityKeyDictionary anymore.

The method's hash is 743354880.

The dictionary's internal array's size is 31.

The association of interest is at index 7.

However 743354880 \\ 31 + 1 is not 7 but 22.

There is nothing (i.e. "nil") at index 22.

DebuggerMethodMap class >> #cacheDebugMap:forMethod: cannot work correctly anymore because #keys and #at: are out of sync. :-(

This is scary. Did the object's hash changed without notice? Does it have to do with method compilation and installation?

A manual #rehash solved the issue for now. :-S

VM: 202111302328 

VMMaker.oscog-eem.3113

squeak.cog.spur (32-bit)

Best,
Marcel
Am 08.12.2021 15:21:32 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hi all --

I somehow corrupted my MapCache in DebuggerMethodMap.



This means that I cannot debug anymore:



I know that I can clear that cache. Yet, it is way more fun to understand how that WeakIdentityKeyDictionary behaves that way.

Best,
Marcel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211208/fa9c67e2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 155443 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211208/fa9c67e2/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 175061 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211208/fa9c67e2/attachment-0003.png>


More information about the Squeak-dev mailing list