NSSelectorFromString crash
NSSelectorFromString crash
- Subject: NSSelectorFromString crash
- From: Stefan Jung <email@hidden>
- Date: Tue, 1 May 2001 16:39:28 +0200
Hello,
I was able to crash NSSelectorFromString with a little help from
the following code:
- (SEL)setAccessorFromIdentifier:(NSString *)identifier
{
NSString *string = [@"set" stringByAppendingString:
[[identifier capitalizedString]
stringByAppendingString:@":"]];
return NSSelectorFromString(string);
}
This method is called from:
- (void)tableView:(NSTableView *)tableView
setObjectValue:(id)object forTableColumn:(NSTableColumn
*)tableColumn row:(int)row
The crash.log looks like:
**********
Date/Time: 2001-05-01 16:32:41 +0200
PID: 2174
Command: MSConstructor
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000000
Thread 0:
#0 0x7017726c in _CFStringGetCString ()
#1 0xbfffe470 in 0xbfffe470 ()
#2 0x7097dae4 in _NSSelectorFromString ()
#3 0x00005178 in -[TableController accessorFromIdentifier:]
#4 0x00004e38 in -[TableController
tableView:objectValueForTableColumn:row:]
#5 0x70f93c04 in -[NSTableView _dataSourceValueForColumn:row:]
#6 0x70f9c550 in -[NSTableView drawRow:clipRect:]
#7 0x70f9c1f8 in -[NSTableView drawRect:]
#8 0x70d535c4 in -[NSView _drawRect:clip:]
#9 0x70d52b88 in -[NSView
_recursiveDisplayAllDirtyWithLockFocus:visRect:]
#10 0x70d5265c in -[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:
topView:]
#11 0x70d52a4c in -[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:
topView:]
#12 0x70d52a4c in -[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:
topView:]
#13 0x70d52a4c in -[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:
topView:]
#14 0x70d52a4c in -[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:
topView:]
#15 0x70e81f28 in -[NSFrameView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:
topView:]
#16 0x70edeb24 in -[NSThemeFrame
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:
topView:]
#17 0x70d50690 in -[NSView
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
#18 0x70d4c94c in -[NSView displayIfNeeded]
#19 0x70d57fe0 in -[NSWindow displayIfNeeded]
#20 0x70d76be4 in __handleWindowNeedsDisplay ()
#21 0x7017a728 in ___CFRunLoopDoObservers ()
#22 0x7017a9f4 in ___CFRunLoopRun ()
#23 0x7017a56c in _CFRunLoopRunInMode ()
#24 0x737dc90c in _RunEventLoopInModeUntilEventArrives ()
#25 0x737dc608 in _ReceiveNextEventCommon ()
#26 0x737dc564 in _BlockUntilNextEventMatchingListInMode ()
#27 0x70d75a08 in __DPSNextEvent ()
#28 0x70d756e8 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:]
#29 0x70d7546c in -[NSApplication run]
#30 0x70d9799c in _NSApplicationMain ()
#31 0x00004378 in _main ()
#32 0x00003ed4 in __start ()
#33 0x00003d14 in start ()
PPC Thread State:
srr0: 0x7017726c srr1: 0x0000f030 vrsave: 0x00000000
xer: 0x00000014 lr: 0x70177240 ctr: 0x7017722c mq: 0x00000000
r0: 0x7097dae4 r1: 0xbfffe460 r2: 0x00060001 r3: 0x00000000
r4: 0xbfffe508 r5: 0x00000080 r6: 0x00000600 r7: 0x00000000
r8: 0x7081ab7c r9: 0x801606f8 r10: 0x00090898 r11: 0x80970e08
r12: 0x7017722c r13: 0x00000000 r14: 0x00000000 r15: 0x00000000
r16: 0x00000000 r17: 0x00000000 r18: 0xbffff788 r19: 0x00000000
r20: 0x00000001 r21: 0x00000001 r22: 0x00bf7fd0 r23: 0xffffffff
r24: 0x00000000 r25: 0xbfffe508 r26: 0x00000080 r27: 0x01098840
r28: 0x00000000 r29: 0x00c0c700 r30: 0x00000600 r31: 0x70177240
**********
NSSelectorFromString should return a valid selector or zero. Why
does it neither in my situation?
Stefan Jung