Mantis - Squeak
Viewing Issue Advanced Details
7593 System crash random 12-28-10 02:35 02-06-11 23:47
closed trunk  
none trunk  
0007593: Preferences is not thread-safe, but is being accessed concurrently
I just had an image freeze that I saw a few times before, even with 3.8 images. If you leave a Transcript open and a process is writing to it, then your image will freeze sooner or later with 100% CPU usage. The problem seems to be that the dictionary of Preferences is accessed concurrently. The dictionary was rehashed by a Process while another Process (the UI Process) was looking for a key in #scanFor:. Because of this the execution reached the last statement (self errorNoFreeSpace). I guess the debugger couldn't be opened, because the error is in the UI process.
Here's the top of the stack trace of the UI process:

Process 0xb8af0878 priority 40
0xffe23a48 M Preferences class>preferenceAt:ifAbsent: -1203790052: a(n) Preferences class
0xffe23a68 M Preferences class>valueOfPreference:ifAbsent: -1203790052: a(n) Preferences class
0xffe23a88 M Preferences class>valueOfFlag:ifAbsent: -1203790052: a(n) Preferences class
0xffe23aa8 M Preferences class>subPixelRenderFonts -1203790052: a(n) Preferences class
0xffe23ac8 M GrafPort(BitBlt)>installStrikeFont:foregroundColor:backgroundColor: -1183465320: a(n) GrafPort
0xffe23aec M GrafPort>installStrikeFont:foregroundColor:backgroundColor: -1183465320: a(n) GrafPort
0xffe23b10 M StrikeFont>installOn:foregroundColor:backgroundColor: -1202043736: a(n) StrikeFont
0xffe23b34 M MultiDisplayScanner>setFont -1183465476: a(n) MultiDisplayScanner
0xffe23b4c M MultiDisplayScanner>setStopConditions -1183465476: a(n) MultiDisplayScanner
0xffe23b68 M MultiDisplayScanner>endOfRun -1183465476: a(n) MultiDisplayScanner
0xffe23b94 M MultiDisplayScanner>displayLine:offset:leftInRun: -1183465476: a(n) MultiDisplayScanner
0xffda8350 M MultiNewParagraph>displayOn:using:at: -1196648352: a(n) MultiNewParagraph
0xffda8378 M FormCanvas>paragraph:bounds:color: -1183465892: a(n) FormCanvas
0xffda83a0 M TextMorphForEditView(TextMorph)>drawOn: -1196757396: a(n) TextMorphForEditView
0xffda83bc M FormCanvas(Canvas)>draw: -1183465892: a(n) FormCanvas
0xffda83d8 M FormCanvas(Canvas)>drawMorph: -1183465892: a(n) FormCanvas
0xffda83f8 M [] in TextMorphForEditView(Morph)>fullDrawOn: -1196757396: a(n) TextMorphForEditView

01-07-11 18:38   
The short term solution is to protect the dictionary with a semaphore or a mutex. The long term solution is to use pragma preferences exclusively.
01-12-11 20:23   
Fixed in System-ul.413.