Error selector changed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Error selector changed

Nicolas Cellier
Hi all,
From time to time, (Compiler recompileAll) fails because some selector
identity changed...

Indeed, following snippet should always be true, but is sometimes false:

    selector == (Symbol findInterned: selector asString).

In such case, I can attempt a doIt and continue:

    selector beWritableObject; becomeForward: (Symbol findInterned:
selector asString).
    oldClass methodDictionary rehash

Sometimes I'm tempted to integrate the workaround directly in code,
but it would just mask a problem. Any clue on how this can happen?

Nicolas

Reply | Threaded
Open this post in threaded view
|

Re: Error selector changed

Christoph Thiede


Hi Nicolas,


I could not reproduce the problem in a fresh trunk image after 12 attempts. How often do you need to recompile the image in order to experience the error, by average?


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Nicolas Cellier <[hidden email]>
Gesendet: Montag, 12. April 2021 19:28:35
An: The general-purpose Squeak developers list
Betreff: [squeak-dev] Error selector changed
 
Hi all,
From time to time, (Compiler recompileAll) fails because some selector
identity changed...

Indeed, following snippet should always be true, but is sometimes false:

    selector == (Symbol findInterned: selector asString).

In such case, I can attempt a doIt and continue:

    selector beWritableObject; becomeForward: (Symbol findInterned:
selector asString).
    oldClass methodDictionary rehash

Sometimes I'm tempted to integrate the workaround directly in code,
but it would just mask a problem. Any clue on how this can happen?

Nicolas



Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: Error selector changed

Graham Kelly
In reply to this post by Nicolas Cellier
Hmm... something similar but worse happens in Cuis.



Graham

On 4/12/21 1:28 PM, Nicolas Cellier wrote:

> Hi all,
>  From time to time, (Compiler recompileAll) fails because some selector
> identity changed...
>
> Indeed, following snippet should always be true, but is sometimes false:
>
>      selector == (Symbol findInterned: selector asString).
>
> In such case, I can attempt a doIt and continue:
>
>      selector beWritableObject; becomeForward: (Symbol findInterned:
> selector asString).
>      oldClass methodDictionary rehash
>
> Sometimes I'm tempted to integrate the workaround directly in code,
> but it would just mask a problem. Any clue on how this can happen?
>
> Nicolas
>

Reply | Threaded
Open this post in threaded view
|

Re: Error selector changed

Nicolas Cellier
In reply to this post by Christoph Thiede
Le lun. 12 avr. 2021 à 21:52, Thiede, Christoph
<[hidden email]> a écrit :
>
>
> Hi Nicolas,
>
>
> I could not reproduce the problem in a fresh trunk image after 12 attempts. How often do you need to recompile the image in order to experience the error, by average?
>

I do not recompileAll often, and I don't think that recompiling is the
action that is causing the Error, it rather reveals the Error.
The root cause is mysterious, and very hard to track since the
consequences get unnoticed...

For those wondering, the problem is that some Symbol get duplicated
violating the contract:
any two Symbols are either identical (==) or different (~=).

>
> Best,
>
> Christoph
>
> ________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag von Nicolas Cellier <[hidden email]>
> Gesendet: Montag, 12. April 2021 19:28:35
> An: The general-purpose Squeak developers list
> Betreff: [squeak-dev] Error selector changed
>
> Hi all,
> From time to time, (Compiler recompileAll) fails because some selector
> identity changed...
>
> Indeed, following snippet should always be true, but is sometimes false:
>
>     selector == (Symbol findInterned: selector asString).
>
> In such case, I can attempt a doIt and continue:
>
>     selector beWritableObject; becomeForward: (Symbol findInterned:
> selector asString).
>     oldClass methodDictionary rehash
>
> Sometimes I'm tempted to integrate the workaround directly in code,
> but it would just mask a problem. Any clue on how this can happen?
>
> Nicolas
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Error selector changed

Chris Muller-3
For those wondering, the problem is that some Symbol get duplicated
violating the contract:
any two Symbols are either identical (==) or different (~=).

Possible become without copyHash? 


Reply | Threaded
Open this post in threaded view
|

Re: Error selector changed

marcel.taeumel
Maybe unrelated, but I will remove that extension "Symbol >> #extern:", which manipulates the symbol tables for a single test in CompilerExceptionTest, present since March 2020. I think that 1) garbage collection should take care of unused symbols and 2) test can find a better way to produce "unknown symbols" :-)

Best,
Marcel

Am 13.04.2021 07:16:48 schrieb Chris Muller <[hidden email]>:

For those wondering, the problem is that some Symbol get duplicated
violating the contract:
any two Symbols are either identical (==) or different (~=).

Possible become without copyHash? 


Reply | Threaded
Open this post in threaded view
|

Re: Error selector changed

Nicolas Cellier
I have a clue:

     Symbol allSubInstances reject: [:s | (Symbol findInterned: s
asString) == s].

returns two problematic Symbols:

    OrderedCollection(#openPluggableFileListLabel:in:
#dialogStringFromQuery:withTitle:).

This means that some duplicated symbols still exist in my image...
And they can end up in the SymbolTable thru (Symbol rehash).

Who did create those duplicates remains an open question, but how the
duplicates might sneak into the SymbolTable is no more a mystery
(though it remains to analyze who does Symbol rehash...)

Le mar. 13 avr. 2021 à 10:10, Marcel Taeumel <[hidden email]> a écrit :

>
> Maybe unrelated, but I will remove that extension "Symbol >> #extern:", which manipulates the symbol tables for a single test in CompilerExceptionTest, present since March 2020. I think that 1) garbage collection should take care of unused symbols and 2) test can find a better way to produce "unknown symbols" :-)
>
> Best,
> Marcel
>
> Am 13.04.2021 07:16:48 schrieb Chris Muller <[hidden email]>:
>>
>> For those wondering, the problem is that some Symbol get duplicated
>> violating the contract:
>> any two Symbols are either identical (==) or different (~=).
>
>
> Possible become without copyHash?
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Error selector changed

Nicolas Cellier
And one of the two duplicated Symbol #openPluggableFileListLabel:in:
appear as both added and removed method in 60Deprecated package! (see
png attached)

Le mar. 13 avr. 2021 à 11:22, Nicolas Cellier
<[hidden email]> a écrit :

>
> I have a clue:
>
>      Symbol allSubInstances reject: [:s | (Symbol findInterned: s
> asString) == s].
>
> returns two problematic Symbols:
>
>     OrderedCollection(#openPluggableFileListLabel:in:
> #dialogStringFromQuery:withTitle:).
>
> This means that some duplicated symbols still exist in my image...
> And they can end up in the SymbolTable thru (Symbol rehash).
>
> Who did create those duplicates remains an open question, but how the
> duplicates might sneak into the SymbolTable is no more a mystery
> (though it remains to analyze who does Symbol rehash...)
>
> Le mar. 13 avr. 2021 à 10:10, Marcel Taeumel <[hidden email]> a écrit :
> >
> > Maybe unrelated, but I will remove that extension "Symbol >> #extern:", which manipulates the symbol tables for a single test in CompilerExceptionTest, present since March 2020. I think that 1) garbage collection should take care of unused symbols and 2) test can find a better way to produce "unknown symbols" :-)
> >
> > Best,
> > Marcel
> >
> > Am 13.04.2021 07:16:48 schrieb Chris Muller <[hidden email]>:
> >>
> >> For those wondering, the problem is that some Symbol get duplicated
> >> violating the contract:
> >> any two Symbols are either identical (==) or different (~=).
> >
> >
> > Possible become without copyHash?
> >
> >



deprecated.png (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Error selector changed

Levente Uzonyi
In reply to this post by marcel.taeumel
Hi Marcel,

To ensure consistency and thread safety without using a mutex, the
two WeakSets which make up the symbol table are treated as if they were
immutable.
Removing from them without creating a copy just breaks that contract.


Levente

On Tue, 13 Apr 2021, Marcel Taeumel wrote:

> Maybe unrelated, but I will remove that extension "Symbol >> #extern:", which manipulates the symbol tables for a single test in CompilerExceptionTest, present since March 2020. I think that 1) garbage collection should take
> care of unused symbols and 2) test can find a better way to produce "unknown symbols" :-)
> Best,
> Marcel
>
>       Am 13.04.2021 07:16:48 schrieb Chris Muller <[hidden email]>:
>
>             For those wondering, the problem is that some Symbol get duplicated
>             violating the contract:
>             any two Symbols are either identical (==) or different (~=).
>
>
> Possible become without copyHash? 
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Error selector changed

marcel.taeumel
Hi Levente,

good to know! Well, I know this pattern, just did not notice it got applied here. Even better that I got rid of #extern:.

Best,
Marcel

Am 13.04.2021 16:41:06 schrieb Levente Uzonyi <[hidden email]>:

Hi Marcel,

To ensure consistency and thread safety without using a mutex, the
two WeakSets which make up the symbol table are treated as if they were
immutable.
Removing from them without creating a copy just breaks that contract.


Levente

On Tue, 13 Apr 2021, Marcel Taeumel wrote:

> Maybe unrelated, but I will remove that extension "Symbol >> #extern:", which manipulates the symbol tables for a single test in CompilerExceptionTest, present since March 2020. I think that 1) garbage collection should take
> care of unused symbols and 2) test can find a better way to produce "unknown symbols" :-)
> Best,
> Marcel
>
> Am 13.04.2021 07:16:48 schrieb Chris Muller :
>
> For those wondering, the problem is that some Symbol get duplicated
> violating the contract:
> any two Symbols are either identical (==) or different (~=).
>
>
> Possible become without copyHash? 
>
>
>