Mantis - Squeak
Viewing Issue Advanced Details
6812 Collections minor always 12-14-07 20:41 04-18-10 22:05
nicolas cellier  
andreas  
normal  
closed 3.10  
fixed  
none    
none trunk  
0006812: Inspecting a changing WeakSet will raise a Debugger
How to reproduce: evaluate:

  (Symbol classPool at: #SymbolTable) inspect.

Then scroll the inspector left pane and you should see a debugger coming after a few flashes, saying something like 'Error: subscript is out of bounds: 687'
Inspector should not fail when the WeakSet changes.
However this also raise the question: why does it change?

This must be related to some short-lived Symbol created then reclaimed.
But why to create such short-lived Symbol?
Is it another bug?
 WideCharacterSet-copy-Test-M3574-nice.1.cs [^] (646 bytes) 12-15-07 10:52
 WideCharacterSet-copy-Patch-M3574-nice.1.cs [^] (729 bytes) 12-15-07 10:52
 WeakSetInspector-M6812-nice-Test.1.cs [^] (1,057 bytes) 12-15-07 10:53
 WeakSetInspector-M6812-nice-Patch.1.cs [^] (690 bytes) 12-15-07 10:53

Notes
(0011541)
nicolas cellier   
12-15-07 10:26   
OK, got it.
It has nothing to do with short-lived Symbols, because these ones are created in another class variable (NewSymbols).

The problem is that (WeakArray species = WeakArray).

Thus, when WeakSetInspector>>#fieldList collect a list of non-nil slot indices, it gather results in a WeakArray.
This weakArray will contain only SmallInteger printString which will soon trigger a reclamation, and make the weakArray shrink.
This leads to a constantly changing list of indices for the WeakSetInspector.

Cure: change WeakArray species? Here i don't know all the implications... Need some guru advice and support.

Other workaround: hack WeakSetInspector>>#fieldList with a object array asArray or something like that...

(0011542)
nicolas cellier   
12-15-07 10:55   
Oops... I uploaded wrong cs (WideCharacterSet) please forget.

Use WeakSetInspector-M6812 test and patch.

Maybe category could be requalified Tools
(0011557)
Keith_Hodges   
12-17-07 15:45   
"fix begin"
Installer mantis bug: 6812 fix: 'WeakSetInspector-M6812-nice-Patch.1.cs'.
"fix test"
Installer mantis bug: 6812 fix: 'WeakSetInspector-M6812-nice-Test.1.cs'.
"fix end"

(0013286)
nicolas cellier   
08-24-09 20:46   
Fixed in http://source.squeak.org/trunk/Tools-nice.116.mcz [^]
ToolsTests-nice.1 is in the trunk... but not automatically loaded