[squeak-dev] Re: 0006721: Identity dictionarys sometimes can't find their keys

Levente Uzonyi leves at elte.hu
Sun Feb 28 20:12:04 UTC 2010


On Sun, 28 Feb 2010, Igor Stasenko wrote:

> On 28 February 2010 19:56, Levente Uzonyi <leves at elte.hu> wrote:
>> On Sun, 28 Feb 2010, Jerome Peace wrote:
>>
>>>
>>> Hi Levente,
>>>
>>> Thank you for your suggestions.
>>>
>>> I am not aiming myself at revising my tests. If you wish to add to them
>>> great. I suggest adding specific suggestions and code to the mantis report.
>>>
>>> For some dictionaries "nil" has become a valid key. The tests in the
>>> report were designed for 3.9 - 3.10 where Dan Ingalls innocent suggestion
>>> that #= replace #==  caused a coder to break #comeFullyUpOnReload. I had to
>>> design a test that proved dictionaries we not getting hashed correctly just
>>> to prove somebody had caused a problem.
>>
>> nil was always a valid key for Dictionary and IdentityDictionary. Sets were
>> the collections which couldn't contain nil.
>>
> except WeakKeyDictionary, for obvious reason.

There are other exceptions, like MethodDictionary. I meant the classes 
here and not the hierarchy they represent.


Levente

>
>>
>> Levente
>>
>>>
>>> The difficulty with dictionary problems is they appear like a
>>> will-of-the-wisp causing very hard to track down mischief. Trust me on this.
>>>
>>> The problem may be recurring so its important to have tests IN THE IMAGE.
>>> That can be run to find them. For Identity dictionaries these test have
>>> proven to work if used. I haven't experimented with the new dictionary
>>> flavors or even with other dictionaries, just the one class.
>>>
>>> The thing I am asking for help with is getting the test from change sets
>>> on a mantis report to live code in an image. I don't have any skill with MC.
>>> I am a Luddite with regards to it and have not taken the first steps to
>>> mastery. This suits me as a debugger. I can find, analyse, and patch bugs
>>> with the old methods. It leaves a gap in getting code committed. So I either
>>> need a book on MC for Luddites or someone to help by committing the code to
>>> resolve the issue. That's what I asked for.
>>>
>>> Once the tests are where they can be used, improvements will be welcome.
>>> The existing tests are good enough to start with. Without something the
>>> image is likely to have bugs way to hard to chase.
>>>
>>> More help in devising and PROVING tests that will find other problems is
>>> welcome. It was not the aim of my post however.
>>>
>>> Cheers --Jer
>>>
>>>> Levente Uzonyi leves at elte.hu
>>>> Sun Feb 28 13:19:40 UTC 2010 replied to:
>>>
>>>> On Sat, 27 Feb 2010, Jerome Peace wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> I could use some help getting some crucial tests into trunk.
>>>>>
>>>>> The patches are in the mantis report of the title.
>>>>> http://bugs.squeak.org/view.php?id=6721
>>>>>
>>>>
>>>> nil is a valid key in Dictionary and IdentityKeyDictionary. A better test
>>>> would be something like this:
>>>>
>>>> { Dictionary. IdentityDictionary } do: [ :dictionaryClass |
>>>>        dictionaryClass allInstancesDo: [ :dictionary |
>>>>                dictionary keysAndValuesDo: [ :key :value |
>>>>                        self assert: (dictionary at: key) == value ] ] ].
>>>>
>>>> Or, if you want to use lower level (private) methods:
>>>>
>>>> { Dictionary. IdentityDictionary } do: [ :dictionaryClass |
>>>>        dictionaryClass allInstancesDo: [ :dictionary |
>>>>                dictionary array doWithIndex: [ :association :index |
>>>>                        association ifNotNil: [
>>>>                                self assert: (dictionary scanFor:
>>>> association key) = index ] ] ] ]
>>>>
>>>>> The ill hashed dictionaries have been detected in Fun Squeak.
>>>>>
>>>>
>>>> The tests above can be used to track down dictionaries which have an
>>>> invalid state.
>>>>
>>>>
>>>> Levente
>>>>
>>>>> I am worried that there is something in the main image that causes
>>>>> conditions to occur so that dictionaries are not rehashed when needed.
>>>>>
>>>>> The problem is that a mis-hashed dictionary will show up only as other
>>>>> symptoms. Code that seemingly doesn't work as expected. Without a ready test
>>>>> to run tracking it back to the true problem is difficult.
>>>>>
>>>>> I have no MC skills so I am asking for someone to take over harvesting
>>>>> from the report.
>>>>>
>>>>> Thank you in advance.
>>>>>
>>>>> Yours in curiosity and service, --Jerome Peace
>>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
> -- 
> Best regards,
> Igor Stasenko AKA sig.
>
>


More information about the Squeak-dev mailing list