[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fix for NSObject on Darwin
From: |
Lars Sonchocky-Helldorf |
Subject: |
fix for NSObject on Darwin |
Date: |
Tue, 28 May 2002 20:32:08 +0200 |
please move line 720 of NSObject.m after line 722 so that it reads like
this:
zombieMap = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
NSNonOwnedPointerMapValueCallBacks, 0);
zombieClass = [NSZombie class];
the reason for this is that on Darwin [NSZombie class] results in calls to
GSLogZombie() what depends on an initialized zombieMap like the following
backtrace shows (NSMapGet chokes on a Nul table argument) here :
Breakpoint 1, 0x00115ae8 in objc_msgSend ()
(gdb) bt
#0 0x00115ae8 in objc_msgSend ()
#1 0x005b10fc in GSDebugFunctionMsg (func=0x6781f0 "NSMapGet",
file=0x678150 "NSMapTable.m", line=345, fmt=0x692734) at NSDebug.m:633
#2 0x005dfc00 in NSMapGet (table=0x0, key=0x6971c8) at NSMapTable.m:345
#3 0x005f2524 in GSLogZombie (o=0x6971c8, sel=0x116a14) at NSObject.m:110
#4 0x005f5c00 in -[NSZombie forward::] (self=0x6971c8, _cmd=0x116ab0,
aSel=0x116a14, argFrame=0xbfffed78) at NSObject.m:1648
#5 0x001161dc in _objc_msgForward ()
#6 0x0010ddb8 in class_initialize (cls=0x6971c8) at
runtime/objc-class.m:2071
#7 0x0010dfd8 in _class_lookupMethodAndLoadCache (cls=0x699658,
sel=0x1169e0) at runtime/objc-class.m:2144
#8 0x00115bd4 in objc_msgSend ()
#9 0x005f2c3c in +[NSObject initialize] (self=0x697228, _cmd=0x116a14) at
NSObject.m:720
#10 0x005f2c3c in +[NSObject initialize] (self=Cannot access memory at
address 0xc24bc21d
) at NSObject.m:720
#11 0x0010ddb8 in class_initialize (cls=0x697228) at
runtime/objc-class.m:2071
#12 0x0010dcdc in class_initialize (cls=0x696748) at
runtime/objc-class.m:2045
#13 0x0010dfd8 in _class_lookupMethodAndLoadCache (cls=0x698bd8,
sel=0x116a08) at runtime/objc-class.m:2144
#14 0x00115bd4 in objc_msgSend ()
#15 0x00608a48 in _gnu_process_args (argc=1, argv=0xbffff3a0,
env=0xbffff3a8) at NSProcessInfo.m:169
#16 0x00608a48 in _gnu_process_args (argc=Cannot access memory at address
0xc24bc26d
) at NSProcessInfo.m:169
#17 0x00609008 in main (argc=1, argv=0xbffff3a0, env=0xbffff3a8) at
NSProcessInfo.m:534
#18 0x000028f0 in _start ()
#19 0x00002720 in start ()
When I move the creation of zombieMap before "zombieClass = [NSZombie
class];" the crash occurs later:
Program received signal EXC_BAD_ACCESS, Could not access memory.
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
Cannot access memory at address 0x0
#1 0x005823c4 in +[NSAutoreleasePool new] (self=0x696748, _cmd=0x116a08)
at NSAutoreleasePool.m:149
#2 0x005dee78 in NSLog (format=0x692a7c) at NSLog.m:113
#3 0x005f2544 in GSLogZombie (o=0x6971c8, sel=0x116a14) at NSObject.m:118
#4 0x005f5bcc in -[NSZombie forward::] (self=0x6971c8, _cmd=0x116ab0,
aSel=0x116a14, argFrame=0xbfffed78) at NSObject.m:1648
#5 0x001161dc in _objc_msgForward ()
#6 0x0010ddb8 in class_initialize (cls=0x6971c8) at
runtime/objc-class.m:2071
#7 0x0010dfd8 in _class_lookupMethodAndLoadCache (cls=0x699658,
sel=0x1169e0) at runtime/objc-class.m:2144
#8 0x00115bd4 in objc_msgSend ()
#9 0x005f2c58 in +[NSObject initialize] (self=0x697228, _cmd=0x116a14) at
NSObject.m:722
#10 0x005f2c58 in +[NSObject initialize] (self=Cannot access memory at
address 0xc24bc21d
) at NSObject.m:722
#11 0x0010ddb8 in class_initialize (cls=0x697228) at
runtime/objc-class.m:2071
#12 0x0010dcdc in class_initialize (cls=0x696748) at
runtime/objc-class.m:2045
#13 0x0010dfd8 in _class_lookupMethodAndLoadCache (cls=0x698bd8,
sel=0x116a08) at runtime/objc-class.m:2144
#14 0x00115bd4 in objc_msgSend ()
#15 0x00608a14 in _gnu_process_args (argc=1, argv=0xbffff3a0,
env=0xbffff3a8) at NSProcessInfo.m:169
#16 0x00608a14 in _gnu_process_args (argc=Cannot access memory at address
0xc24bc26d
) at NSProcessInfo.m:169
#17 0x00608fd4 in main (argc=1, argv=0xbffff3a0, env=0xbffff3a8) at
NSProcessInfo.m:534
#18 0x000028f0 in _start ()
#19 0x00002720 in start ()
thanks, Lars
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- fix for NSObject on Darwin,
Lars Sonchocky-Helldorf <=