I found the freeze, eventually crashes if I bothered to wait a little longer.
The thread with the crash has the following traceback...
#0 0x92ea2756 in _cache_malloc
#1 0x92ea257e in _cache_fill
#2 0x92eaa6ff in lookUpMethod
#3 0x92ea1da7 in _class_lookupMethodAndLoadCache
#4 0x92ea1953 in objc_msgSend
#5 0x96cf95f2 in +[_NSCallStackArray arrayWithFrames:count:symbols:]
#6 0x96cf96d1 in +[NSThread callStackSymbols]
#7 0x9129c58a in __raiseError
#8 0x92ea5f49 in objc_exception_throw
#9 0x96d95fda in _NSOutOfMemoryErrorHandler
#10 0x911cd632 in _CFRuntimeCreateInstance
#11 0x911cd2ab in CFBasicHashCreate
#12 0x911cf358 in __CFDictionaryCreateGeneric
#13 0x911cf131 in CFDictionaryCreateMutable
#14 0x911f379f in -[__NSPlaceholderDictionary initWithCapacity:]
#15 0x911f3712 in -[__NSPlaceholderDictionary init]
#16 0x9129c51b in __raiseError
#17 0x92ea5f49 in objc_exception_throw
#18 0x96d95fda in _NSOutOfMemoryErrorHandler
#19 0x912ca88b in __CFStringHandleOutOfMemory
#20 0x911d6045 in __CFStringChangeSizeMultiple
#21 0x911f3085 in __CFStringAppendBytes
#22 0x911f6112 in _CFStringAppendFormatAndArgumentsAux
#23 0x911f5429 in _CFStringCreateWithFormatAndArgumentsAux
#24 0x911fdbfe in CFStringCreateWithFormatAndArguments
#25 0x911fdbc9 in CFStringCreateWithFormat
#26 0x911cd60e in _CFRuntimeCreateInstance
#27 0x98c5139d in CGTypeCreateInstanceWithAllocator
#28 0x98c51fae in CGTypeCreateInstance
#29 0x98c5ddb9 in CGColorCreate
#30 0x9426040d in -[NSDeviceRGBColor _createCGColorWithAlpha:]
#31 0x9424c3c2 in -[NSCalibratedRGBColor set]
#32 0x00086f00 in -[Value2dDisplay updateDisplay]
#33 0x000033b4 in -[HeatbugsGUI updateGraphicalDisplays] at HeatbugsGUI.m:156
#34 0x00084f0b in __builtin_avcall
#35 0x0007cb25 in -[Activity_c _run_]
#36 0x0007c94b in -[Activity_c _run_]
#37 0x0007c94b in -[Activity_c _run_]
#38 0x0007c94b in -[Activity_c _run_]
#39 0x0007c65f in -[Activity_c run]
#40 0x000776ee in -[ScheduleActivity_c stepUntil:]
#41 0x00086405 in -[OpenStepSwarmController processStateFlag]
#42 0x000865cf in -[OpenStepSwarmController simulationControl:]
#43 0x00086113 in -[OpenStepSwarmController newSimulation:]
#44 0x96c7b964 in -[NSThread main]
#45 0x96c7b914 in __NSThread__main__
#46 0x97aaef39 in _pthread_start
#47 0x97aaedbe in thread_start
Note that I've disabled threading to simplify things a little.
The segment from my code that is involved in this is as follows...
- (void)updateGraphicalDisplays {
// Update any displays with current model state.
#if THREADED > 0
if([lock tryLock]) {
[NSThread detachNewThreadSelector:@selector(updateHeatSpaceDisplay)
toTarget:self
withObject:nil];
[lock unlock];
}
if([lock tryLock]) {
[NSThread detachNewThreadSelector:@selector(updateHeatbugDisplay)
toTarget:self
withObject:nil];
[lock unlock];
}
#else
[heatSpaceDisplay updateDisplay];
[heatbugDisplay updateDisplay];
//. Inform ourselves that updates are complete and graphical views
//. should be re-displayed.
[self swarmHasUpdatedNotification];
#endif
//. [self viewNeedsDisplay: [_delegate heatbugSpaceView]];
}
Tarball coming up next.