Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 913 by benjamin...(a)gmail.com:
MorphTreeTransformMorph>>drawSubmorphsOn: race condition
http://code.google.com/p/moose-technology/issues/detail?id=913
In my application using Glamour I was often getting a "red square of
death". I tracked this down to MorphTreeTransformMorph>>drawSubmorphsOn:
where the line "m := submorphs basicAt: row." generates a being a
SubscriptOutOfBounds. Part of the cause is that my application is
generating update announcements quite fast, but this is also what provided
reproducability to be able to track this down. Otherwise this probably
only occurs infrequently seemingly at random.
I managed to condense this to the following artificial Workspace example.
To set up, execute the first three comments (later you can cleanup with the
fourth comment), then execute the rest of the script.
--------
"Smalltalk at: #TestAnnouncer put: Announcer new ."
"Smalltalk at: #TestTree put: (MAContainer new label: 'root')."
"Transcript open"
"Smalltalk removeKey: #TestAnnouncer ; removeKey: #TestTree"
| browser |
TestTree := MAContainer new label: 'root'.
1 to: 20 do: [ :x | TestTree add: (MAContainer new label: x) ].
browser := GLMTabulator new.
browser column: #one.
browser transmit to: #one; andShow:
[ :a |
a tree
updateOn: AnnouncementMockA from: TestAnnouncer ;
allExpanded;
children: [:x :i | x children ].
].
browser openOn: TestTree.
--------
Then after that has opened, execute the following:
----
[ 10 timesRepeat:
[
101 to: 110 do:
[ :y |
(TestTree children at: 5) add: (MAContainer new label: y).
TestAnnouncer announce: AnnouncementMockA.
].
(TestTree children at: 5) children removeAll .
TestAnnouncer announce: AnnouncementMockA.
] ] fork.
----
and the tree list should go red.
File in the attached .st file and repeat. Now the tree list doesn't go red.
This is likely more an upstream problem with MorphTreeTransformMorph than
with Glamour, but Glamour is what I had as my test case. I didn't know how
to use MorphTreeTransformMorph directly.
I could probably have a go at fixing this myself after some discussion and
direction.
This was tested in Moose-suite-4-7-beta-20120103.
cheers -ben
Attachments:
MorphTreeTransformMorph-drawSubmorphsOn.st 1.1 KB