[Top][All Lists]

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

Re: NSString retain crash

From: Luboš Doležel
Subject: Re: NSString retain crash
Date: Mon, 15 Oct 2012 21:38:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1


- gnustep-base 1.2.40 (Gentoo -r1)
- libobjc2 1.6.1
- clang 3.1
- Gentoo Linux
- not yet, I'll do that

With the old GCC ObjC runtime, the same code says "NXConstantString doesn't recognize retain" and it crashes as well. I don't think that's correct either, but the new runtime is what bothers me more.


On 10/15/2012 08:45 PM, Ivan Vučica wrote:

Just a bit of information collecting:
- which version of GNUstep Base are you using (or, which svn revision if 
- which runtime are you using (gcc libobjc, libobjc2, or something else) and 
which version (or svn revision)?
- which compiler and version?
- which OS (a Linux-based OS, or a BSD, or something else)?
- if you are not using latest svn revision of GNUstep Base, did you try that?

Info above may help someone reproduce the problem or suggest a fix. Looks nasty 
to me, but is probably easy to fix.


Ivan Vučica
via phone

15. 10. 2012., u 12:04, Luboš Doležel <address@hidden> napisao:


I have a problem where setting NSCell's value to a string crashes. I've tracked 
to problem down to a simple test that reproduces the crash:

NSString* str = @"test";
[str retain];


#0  objc_msg_lookup_internal (receiver=<optimized out>, selector=<optimized out>, 
receiver=<optimized out>, selector=<optimized out>, sender=<optimized out>) at sendmsg2.c:66
#1  objc_msg_lookup (receiver=<optimized out>, selector=<optimized out>) at 
#2  0x0000000000400796 in main () at str-retain.m:6

Why does the retain call cause a crash? I've learned that such constant strings 
don't use refcounting internally, but I don't think it should crash anyway.

Luboš Doležel

Discuss-gnustep mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]