swarm-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [swarm-hackers] Heatbugs (my modified version) crashes after lettin


From: Nima Talebi
Subject: Re: [swarm-hackers] Heatbugs (my modified version) crashes after letting it run for ~20 minutes - Help!
Date: Tue, 17 Nov 2009 10:15:56 +1100

Thank you Scott...

Just reading this has given me a pretty good idea - I execute the threads and then call [self swarmHasUpdatedNotification], not having any garantee that the threads have finished (because I wasn't smart enough to know I had to) - that must be it!  I'll try that out, and also look into how to show the traceback of the lightweights and not just the main - another thing I'd completely overlooked as I've not done any multi-threaded work until recently :)

Nima


On Tue, Nov 17, 2009 at 5:46 AM, Scott Christley <address@hidden> wrote:

You might also want to check the traceback for the other thread.  The thread you show is the main thread which controls the GUI.  The other thread is the one running the Swarm simulation.  I would see these errors when I originally was doing Swarm on Openstep work, the cause was usually that the display code was trying to access some objects or variables of the swarm model, but the simulation was continuing to run, and the object or variables had changed, thus causing an invalid memory access or similar crash.

The solution is that when the GUI is updated, the simulation needs to be halted, then all of the GUI views can update themselves based upon the current frozen state of the simulation.  To make this easier, the updating is done in this method of HeatbugsGUI


- (void) updateGraphicalDisplays


which calls at the end


[self swarmHasUpdatedNotification];


This will trigger a call *on the main GUI thread* to this method of MyDocument

- (void)swarmHasUpdated: (id)sender

which will trigger the GUI redisplay.

Scott

On Nov 16, 2009, at 2:47 AM, Nima Talebi wrote:

Hi All,

I'm wondering on how I can debug this. What I do know, is that there is no memory leak, other than that from within the framework which is bounded (hence not the reason), and I can see that the crash is not occurring in the heatbugs code (based on the traceback).  All I have is this...

#0 0x92ea1917 in objc_msgSend
#1 0x2b55e080 in ??
#2 0x94241946 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
#3 0x9423fe9e in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#4 0x94240e13 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#5 0x94240e13 in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#6 0x9423fa13 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#7 0x9423c359 in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
#8 0x9419cf26 in -[NSView displayIfNeeded]
#9 0x94166292 in -[NSWindow displayIfNeeded]
#10 0x94197764 in _handleWindowNeedsDisplay
#11 0x91249b02 in __CFRunLoopDoObservers
#12 0x9120665d in __CFRunLoopRun
#13 0x91205d34 in CFRunLoopRunSpecific
#14 0x91205b61 in CFRunLoopRunInMode
#15 0x92423fec in RunCurrentEventLoopInMode
#16 0x92423da3 in ReceiveNextEventCommon
#17 0x92423c28 in BlockUntilNextEventMatchingListInMode
#18 0x9416dc95 in _DPSNextEvent
#19 0x9416d50a in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#20 0x9412f69b in -[NSApplication run]
#21 0x94127735 in NSApplicationMain
#22 0x00003201 in main at main.m:23

...so seems related to the view - but where?

Note that it does not always crash and sometimes goes for ever - I also tried the UI's 'Sudden Termination' - didn't reveal anything terribly useful.

Also, I'd like to get the Probes running on OS X - any work on this happening?

Nima


--
Nima Talebi
web: http://ai.autonomy.net.au/People/Nima
gpg: B51D 1F18 D8E2 B702 B027 23A4 E06B DAC1 BE70 ADC0
_______________________________________________
swarm-hackers mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/swarm-hackers


_______________________________________________
swarm-hackers mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/swarm-hackers




--
Nima Talebi
web: http://ai.autonomy.net.au/People/Nima
gpg: B51D 1F18 D8E2 B702 B027 23A4 E06B DAC1 BE70 ADC0

reply via email to

[Prev in Thread] Current Thread [Next in Thread]