Archive of April 2006

fixed

yeah, it's okay now. I seem to've broken the persistence of the app, though. Ah well. Not terribly important, now. Almost "there" –€” that is, ready to actually show this thing to other people.

1146242596 53

core data + multithreading =

:(


statement still active

hmm... thread 1:

#0  0x944d4318 in sqlite3VdbeExec
#1  0x944d4d6c in sqlite3VdbeExec
#2  0x940ed3b4 in -[NSSQLiteConnection _execute]
#3  0x940ed298 in -[NSSQLiteConnection execute]
#4  0x940effc0 in -[NSSQLChannel selectRowsWithFetchRequest:]
#5  0x94124e14 in -[NSSQLCore _newRowsForSelector:withArgument:andLimit:]
#6  0x940ef71c in -[NSSQLCore objectsForFetchRequest:inContext:]
#7  0x940ef5cc in -[NSSQLCore executeRequest:withContext:]
#8  0x940e36f8 in -[NSPersistentStoreCoordinator(_NSInternalMethods) executeRequest:withContext:]
#9  0x940e2b20 in -[NSManagedObjectContext executeFetchRequest:error:]
#10 0x00068af0 in -[GATableDataSource population] at GATableDataSource.m:51
#11 0x00068420 in -[GATableDataSource tableView:objectValueForTableColumn:row:] at GATableDataSource.m:12
#12 0x937d23f4 in -[NSTableView _drawContentsAtRow:column:clipRect:]
#13 0x937d1e78 in -[NSTableView drawRow:clipRect:]
#14 0x937d1c34 in -[NSTableView drawRowIndexes:clipRect:]
#15 0x937d12bc in -[NSTableView drawRect:]
#16 0x93765e78 in -[NSView _drawRect:clip:]
#17 0x93765438 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
#18 0x93764a00 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#19 0x93764fc8 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#20 0x93764fc8 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#21 0x93764fc8 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#22 0x93764fc8 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#23 0x93785664 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#24 0x9375e674 in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
#25 0x93753968 in -[NSView displayIfNeeded]
#26 0x937537d8 in -[NSWindow displayIfNeeded]
#27 0x93753684 in _handleWindowNeedsDisplay
#28 0x907e3cd8 in blogCFRunLoopDoObservers
#29 0x907e3f78 in blogCFRunLoopRun
#30 0x907e3a18 in CFRunLoopRunSpecific
#31 0x9321d980 in RunCurrentEventLoopInMode
#32 0x9321d014 in ReceiveNextEventCommon
#33 0x9321ce80 in BlockUntilNextEventMatchingListInMode
#34 0x93720104 in _DPSNextEvent
#35 0x9371fdc8 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#36 0x9371c30c in -[NSApplication run]
#37 0x9380ce68 in NSApplicationMain
#38 0x00011fac in main at main.m:14

thread 2:

#0  0x90005f6c in syscall
#1  0x92991120 in _NSRaiseError
#2  0x940e2ccc in -[NSManagedObjectContext executeFetchRequest:error:]
#3  0x00068af0 in -[GATableDataSource population] at GATableDataSource.m:51
#4  0x00068384 in -[GATableDataSource numberOfRowsInTableView:] at GATableDataSource.m:7
#5  0x937c7178 in -[NSTableView numberOfRows]
#6  0x937c6de0 in -[NSTableView _verifySelectionIsOK]
#7  0x937c6894 in -[NSTableView tile]
#8  0x937c6764 in -[NSTableView _tileAndRedisplayAll]
#9  0x000688ac in -[GATableDataSource update] at GATableDataSource.m:32
#10 0x0003b304 in -[GAThreadController createPopulation] at GAThreadController.m:77
#11 0x0003aa6c in +[GAThreadController createPopulationWithGlob:] at GAThreadController.m:17
#12 0x92976194 in forkThreadForFunction
#13 0x9002ba68 in _pthread_body

It's pretty clear what's happening. So it shouldn't be too difficult to fix. That last problem was bindings-related, and it was happening far too deep inside code that I can't see, so I finally settled on just scrapping bindings altogether and doing all the table updating & stuff by "hand".


oh

from the latest debugging session; this is another CFRetain / _NSKeyValueObservationInfoCreateByRemoving -related crash.

Exception raised during posting of notification.  Ignored.  exception: [<NSManagedObject 0x3dcc40> removeObserver:<NSTableBinder 0x37cff0> forKeyPath:@"generation.number"] was sent to an object that has no observers.

CRASH

thread 1:

#0  0x90810820 in CFSetGetValueIfPresent
#1  0x929ff794 in NSHashInsertKnownAbsent
#2  0x93974c28 in -[_NSModelObservingTracker _startObservingModelObject:]
#3  0x93974b68 in -[_NSModelObservingTracker startObservingModelObjectAtReferenceIndex:]
#4  0x93974a5c in -[_NSModelObservingTracker setObservingToModelObjectsRange:]
#5  0x93974870 in -[_NSBindingAdaptor tableView:updateVisibleRowInformation:]
#6  0x937d0f24 in -[NSTableView drawRect:]
#7  0x93765e78 in -[NSView _drawRect:clip:]
#8  0x93765438 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
#9  0x93764a00 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#10 0x93764fc8 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#11 0x93764fc8 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#12 0x93764fc8 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#13 0x93764fc8 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#14 0x93785664 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#15 0x9375e674 in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
#16 0x93753968 in -[NSView displayIfNeeded]
#17 0x937537d8 in -[NSWindow displayIfNeeded]
#18 0x93753684 in _handleWindowNeedsDisplay
#19 0x907e3cd8 in blogCFRunLoopDoObservers
#20 0x907e3f78 in blogCFRunLoopRun
#21 0x907e3a18 in CFRunLoopRunSpecific
#22 0x9321d980 in RunCurrentEventLoopInMode
#23 0x9321d014 in ReceiveNextEventCommon
#24 0x9321ce80 in BlockUntilNextEventMatchingListInMode
#25 0x93720104 in _DPSNextEvent
#26 0x9371fdc8 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#27 0x9371c30c in -[NSApplication run]
#28 0x9380ce68 in NSApplicationMain
#29 0x00011fac in main at main.m:13

thread 2:

#0  0x9002c128 in semaphore_wait_signal_trap
#1  0x90030bec in pthread_cond_wait
#2  0x9374d74c in -[NSViewHierarchyLock lockForWriting]
#3  0x9374c458 in -[NSView setFrameSize:]
#4  0x93760e08 in -[NSControl setFrameSize:]
#5  0x937c7e84 in -[NSTableView setFrameSize:]
#6  0x937c6958 in -[NSTableView tile]
#7  0x937c6764 in -[NSTableView _tileAndRedisplayAll]
#8  0x9396e9fc in -[NSTableBinder _updateContent]
#9  0x9396e7e0 in -[NSTableBinder _observeValueForKeyPath:ofObject:context:]
#10 0x9396e5c4 in -[NSTableBinder observeValueForKeyPath:ofObject:change:context:]
#11 0x929fcd08 in -[NSObject(NSKeyValueObservingPrivate) _notifyObserversForKeyPath:change:]
#12 0x93972608 in -[NSController _notifyObserversForKeyPath:change:]
#13 0x93972420 in -[NSArrayController didChangeValuesForArrangedKeys:objectKeys:indexKeys:]
#14 0x93971b24 in -[NSArrayController setContent:]
#15 0x93bfee98 in -[_NSManagedProxy _managedObjectsChangedInContext:]
#16 0x92975ad8 in _nsnote_callback
#17 0x9080b4c4 in blogCFXNotificationPost
#18 0x908035a0 in _CFXNotificationPostNotification
#19 0x9295fee0 in -[NSNotificationCenter postNotificationName:object:userInfo:]
#20 0x940e22cc in -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:]
#21 0x940e2244 in -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes:]
#22 0x940e16e8 in -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:]
#23 0x940e2a60 in -[NSManagedObjectContext executeFetchRequest:error:]
#24 0x0003e604 in -[GAThreadController prefForKey:] at GAThreadController.m:327
#25 0x0003ed74 in -[GAThreadController selectObjectThroughTourney:] at GAThreadController.m:407
#26 0x0003d170 in -[GAThreadController runSystem] at GAThreadController.m:179
#27 0x0003bf5c in +[GAThreadController runSystemWithGlob:] at GAThreadController.m:46
#28 0x92976194 in forkThreadForFunction
#29 0x9002ba68 in _pthread_body

evolution is dirty

so I think I've got that last problem solved. But there's a problem in my fitness function, such that if there's an error in the creation of the file needed for analysis (in this case, caused by evaluating a beast with no genes at all), the fitness is inordinately high. (it gets a fitness of 0, which for this test, is the best possible).
So, evolution being the dirty, cheating fink it is, jumps all over that.
It sorta makes me happy, but it's still a low-down filthy trick.