Re: Crash on NSMenu
Re: Crash on NSMenu
- Subject: Re: Crash on NSMenu
- From: Jean Bovet <email@hidden>
- Date: Sun, 7 Dec 2003 21:55:31 +0100
The complete crash log is below. I know that there can be issue with
the memory but this crash is hard to reproduce. The software uses
NSDocument.
Date/Time: 2003-12-05 10:50:50 -0800
OS Version: 10.3.1 (Build 7C107)
Command: Curvus Pro X (/Applications/Curvus Pro X/Curvus Pro
X.app/Contents/MacOS/Curvus Pro X)
PID: 563
Thread: 0
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000000
Thread 0 Crashed:
#0 0x90831234 in objc_msgSend (objc_msgSend + 20)
#1 0x92de78fc in -[NSMenu _enableItems] (-[NSMenu _enableItems] +
312)
#2 0x92e06a64 in -[NSMenu(carbonMenu_Private) _recursiveEnableItems]
(-[NSMenu(carbonMenu_Private) _recursiveEnableItems] + 36)
#3 0x92e06ab8 in -[NSMenu(carbonMenu_Private) _recursiveEnableItems]
(-[NSMenu(carbonMenu_Private) _recursiveEnableItems] + 120)
#4 0x92e2ecc0 in _NSHandleCarbonMenuEvent (_NSHandleCarbonMenuEvent
+ 140)
#5 0x92dd2dd0 in _DPSNextEvent (_DPSNextEvent + 1232)
#6 0x92de93fc in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] (-[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] + 116)
#7 0x92dfd730 in -[NSApplication run] (-[NSApplication run] + 540)
#8 0x92eb9a1c in NSApplicationMain (NSApplicationMain + 464)
#9 0x0006c7ec in main (main + 16)
#10 0x000028dc in _start (crt.c:267)
#11 0x0000275c in start (start + 48)
Thread 1:
#0 0x90017048 in semaphore_wait_signal_trap
(semaphore_wait_signal_trap + 8)
#1 0x9000e890 in _pthread_cond_wait (_pthread_cond_wait + 624)
#2 0x90a4c03c in -[NSConditionLock lockWhenCondition:]
(-[NSConditionLock lockWhenCondition:] + 68)
#3 0x92dca928 in -[NSUIHeartBeat _heartBeatThread:] (-[NSUIHeartBeat
_heartBeatThread:] + 400)
#4 0x90a3a198 in forkThreadForFunction (forkThreadForFunction + 108)
#5 0x900247e8 in _pthread_body (_pthread_body + 40)
PPC Thread State:
srr0: 0x90831234 srr1: 0x0000f030 vrsave: 0x00000000
cr: 0x48044224 xer: 0x00000004 lr: 0x92de78fc ctr: 0x90831220
r0: 0x92de78fc r1: 0xbffff3e0 r2: 0xffffffff r3: 0x05f5f980
r4: 0x9088cf18 r5: 0x001314ec r6: 0x00437810 r7: 0x061b3740
r8: 0x00004408 r9: 0x05f5f980 r10: 0x000007c8 r11: 0xa2dc1f84
r12: 0x00000000 r13: 0x00000000 r14: 0x00000000 r15: 0x00000000
r16: 0x00000000 r17: 0xbffff620 r18: 0x00000000 r19: 0x00401250
r20: 0xffffffff r21: 0xa2df2918 r22: 0xa2df77c4 r23: 0x07f8e8e0
r24: 0x00000010 r25: 0x00000003 r26: 0x07f8e2e0 r27: 0xa2dee8bc
r28: 0x05f5f980 r29: 0x061b3740 r30: 0x001314ec r31: 0x92de77c4
Le 7 dic. 03, ` 16:19, lbland a icrit :
hi-
I bet you have that crash in mac os x 10.3, but not 10.2? Apple
changed their menu updating and now targets that are no longer valid
produce that crash, at least in the one application where I had to
find it. I imagine the menu updating does some target checking, like
checking to see if the target implements a selector, before updating
the menu. In the case of emptying the menu the checking is probably
overkill.
Are you using NSDocument? I bet you have a document component
referenced by a menu and it is on the autorelease pool and is freed
before the menu is updated?
I had a hard time tracking it down because of the non-localized nature
of it and the fact that the error message was indirect. But, it
shouldn't be too hard to figure out what menu item you have that
causes the problem.
-lance
Lance Bland
mailto:email@hidden
VVI
888-VVI-PLOT
http://www.vvi.com
On Sunday, December 7, 2003, at 08:15 AM, Stiphane Sudre wrote:
What's the code you're using? Do you check retainCount?
What's the header of the Crash log?
On dimanche, dicembre 7, 2003, at 12:42 AM, Jean Bovet wrote:
I have a crash with my application in the following way: when I
create a document, I add new menu items to the main menu bar and
when the last document is closed, I remove these items. Sometimes
(and that's the problem) , when I click in the menu bar after
removing (or adding) menu items, the app crash as shown in the crash
log below:
Thread 0 Crashed:
#0 0x90831550 in _class_lookupMethodAndLoadCache
(_class_lookupMethodAndLoadCache + 112)
#1 0x908312d8 in objc_msgSend (objc_msgSend + 184)
#2 0x92de78fc in -[NSMenu _enableItems] (-[NSMenu _enableItems] +
312)
#3 0x92e06a64 in -[NSMenu(carbonMenu_Private)
_recursiveEnableItems] (-[NSMenu(carbonMenu_Private)
_recursiveEnableItems] + 36)
#4 0x92e06ab8 in -[NSMenu(carbonMenu_Private)
_recursiveEnableItems] (-[NSMenu(carbonMenu_Private)
_recursiveEnableItems] + 120)
#5 0x92e2ecc0 in _NSHandleCarbonMenuEvent
(_NSHandleCarbonMenuEvent + 140)
#6 0x92dd2dd0 in _DPSNextEvent (_DPSNextEvent + 1232)
#7 0x92de93fc in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] (-[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] + 116)
#8 0x92dfd730 in -[NSApplication run] (-[NSApplication run] + 540)
#9 0x92eb9a1c in NSApplicationMain (NSApplicationMain + 464)
#10 0x0006c7ec in main (main + 16)
#11 0x000028dc in _start (crt.c:267)
#12 0x0000275c in start (start + 48)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.