On 15 Apr 2011, at 13:30, Mathieu Suen wrote: > Hi > > I am trying to debug a segmentation fault when sending the message > NSWindow>>setTitle: >> From gdb the backtrace is: > > ... > #5 <signal handler called> > #6 0x002185ab in objc_msg_lookup () from /usr/lib/libobjc.so.2 > #7 0x008200e1 in -[NSWindow setTitle:] (self=0x8477c28, _cmd=0x9fb128, > aString=0x852b338) at NSWindow.m:1203 > ... > > The frame 7 is stuck in the first message send: > 1203 if ([_windowTitle isEqual: aString] == NO) > > But every thing seems normal: > > (gdb) p _windowTitle > $5 = (struct NSString *) 0x65637275 > (gdb) po 0x852b338 > <unnamed class> new "0x852b338" > > > If someone have an idea?
Crashes in message sending are usually caused by the receiver being invalid (so the runtime tries to dereference its isa pointer, but gets some nonsense instead). Have you tried running the app in valgrind? It is probably a missing -retain message somewhere. In this case, it looks like _windowTitle has been deallocated prematurely, and you have a dangling reference to it. David -- Sent from my STANTEC-ZEBRA _______________________________________________ Etoile-discuss mailing list [email protected] https://mail.gna.org/listinfo/etoile-discuss
