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

Re: [sc-users] gui crashes




On Jun 9, 2006, at 5:51 AM, James Harkins wrote:
Hi, is there an update on when this might be fixed? It's quite a bother.

I'll revert to an older version of sc.app for now...
hjh


OK the reason this happens is that I fixed a bug where SCGraphViews were being leaked because [super dealloc] was not being called, and this revealed a bug introduced by jrhb when he moved the onClose.value to the top of SCWindow-closed. Why was this done? I can find no reason given in the mailing list around the date of the check-in. I assume perhaps so that the user has access to the dataptr?

Revision 4421 - (view) (download) (annotate) - [select for diffs] 
Modified Tue Apr 5 14:38:45 2005 UTC (14 months, 3 weeks ago) by jrhb 
File length: 3257 byte(s) 
call onClose first.


What happens is the the class browser gets a 'closed' method, it calls onClose, that calls 'free' on the browser and that tests to see if the window is closed and if not, it closes the window.  The problem is that by moving onClose.value before dataptr is set to nil, the test to see if the window is closed returns false and so the view is sent the close message after it is already dealloced.

Anyway, I think I've fixed it by adding an isClosed flag instance variable and not relying on dataptr to indicate whether the window is closed.

This had nothing to do with the UDP packet size limit change.



On Jun 4, 2006, at 8:26 AM, blackrain wrote:

Hi all,
Closing the window of a ClassBrowser or Crucial's MultipageLayout
causes my builds of the app to crash.

This started to happen some days ago when there were changes to the
virtual machine; changes needed to support the removal of the upd
packet size limit.

I get this message at the console when the crash occurs:

/Users/blah/SuperCollider_f/SuperCollider.app/Contents/MacOS/SuperCollider:
objc: FREED(id): message isProxy sent to freed object=0x2164e90

sometimes I get a crash dump:

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x039ca19b

Thread 0 Crashed:
#0   0x9068ba50 in objc_msgSend
 #1   0x97dfca2c in -[NSInvocation invoke]
 #2   0x00016490 in -[SCVirtualMachine performDeferredOperations]
(SCVirtualMachine.M:237)
 #3   0x00015f78 in -[SCVirtualMachine doPeriodicTask:]
(SCVirtualMachine.M:125)
#4   0x97df4dc0 in __NSFireTimer
#5   0x901631dc in __CFRunLoopDoTimer
#6   0x90148c70 in __CFRunLoopRun
 #7   0x90180f04 in CFRunLoopRunSpecific
 #8   0x969a3b70 in RunCurrentEventLoopInMode
 #9   0x969b3a78 in ReceiveNextEventCommon
 #10  0x969dabbc in BlockUntilNextEventMatchingListInMode
#11  0x9308e4cc in _DPSNextEvent
 #12  0x930a0824 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:]
 #13  0x930b23f4 in -[NSApplication run]
 #14  0x931605cc in NSApplicationMain
 #15  0x00004428 in _start (crt.c:267)
#16  0x000042a8 in start

Thread 1:
 #0   0x9002560c in recvfrom
 #1   0x000a7200 in _ZN12SC_UdpInPort3RunEv (SC_ComPort-jaguar.cpp:312)
#2   0x90020c28 in _pthread_body

Thread 2:
#0   0x90006a28 in clock_sleep_trap
 #1   0x9000672c in nanosleep
#2   0x90006670 in sleep
 #3   0x00054fd8 in _Z12resyncThreadPv (PyrSched.cpp:374)
#4   0x90020c28 in _pthread_body

Thread 3:
#0   0x9003e9a8 in semaphore_wait_signal_trap
#1   0x9003e7c4 in _pthread_cond_wait
 #2   0x00055a64 in _ZN10TempoClock3RunEv (PyrSched.cpp:826)
#3   0x90020c28 in _pthread_body

Thread 4:
#0   0x9003e9a8 in semaphore_wait_signal_trap
#1   0x9003e7c4 in _pthread_cond_wait
 #2   0x000550a0 in _Z12schedRunFuncPv (PyrSched.cpp:400)
#3   0x90020c28 in _pthread_body

PPC Thread State:
 srr0: 0x9068ba50 srr1: 0x0200f030                vrsave: 0x00000000
  xer: 0x20000000   lr: 0x97dfca2c  ctr: 0x9068ba3c   mq: 0x00000000
   r0: 0x97dfca2c   r1: 0xbfffe5e0   r2: 0x28004444   r3: 0x0182d490
   r4: 0x906bed50   r5: 0x00000004   r6: 0x0182d490   r7: 0xa1b1c1d3
   r8: 0x00000080   r9: 0x00000000  r10: 0x97df8ebc  r11: 0xa7df1638
  r12: 0x039ca17b  r13: 0x00000000  r14: 0x00000000  r15: 0x00000001
  r16: 0x00000000  r17: 0x00000000  r18: 0x24004420  r19: 0x00000000
  r20: 0x00000000  r21: 0x00000000  r22: 0x00849020  r23: 0x00849128
  r24: 0x001d0000  r25: 0x001cdb48  r26: 0x001cdc6c  r27: 0x001cded0
  r28: 0x001cded4  r29: 0x906b669c  r30: 0x001cdb70  r31: 0x97dfc9d8


as a temporary fix, I commented the following lines:
(I know some objects may not be released for ClassBrowser and MPL
doesnt close all windows)

for ClassBrowser - Line 35:

w = SCWindow("class browser", Rect(128, 320, 640, 560))
.onClose_({ /*this.free*/ }); // < -- crash

for MultiPageLayout  - Line 94:

close { // called when the GUIWindow closes
if(isClosed.not,{
isClosed = true;
autoRemoves.do({ arg updater; updater.remove(false) });
autoRemoves = nil;
if(windows.notNil,{
windows.do({ arg w;
// w.close; // <-- crash
});
windows=views=nil;
});
NotificationCenter.notify(this,\didClose);
});
}

anyone else experiencing the same problem?
any ideas are apreciated.

TIA,

x
_______________________________________________
sc-users mailing list


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman

_______________________________________________
sc-users mailing list