gnustep-dev
[Top][All Lists]
Advanced

[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: Tue, 16 Oct 2012 15:51:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1

Hi,

turns out that everything works as expected when I specify

-fconstant-string-class=NSConstantString

I'm not sure what the difference to the default NXConstantString is, but it works now.

Luboš

On 15.10.2012 21:38, Luboš Doležel wrote:
Hi,

- 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.

Luboš

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

Just a bit of information collecting:
- which version of GNUstep Base are you using (or, which svn revision
if applicable)?
- 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.

Regards,

Ivan Vučica
via phone

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

Hi,

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];

Backtrace:

#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 sendmsg2.c:398
#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.

Thanks!
--
Luboš Doležel


_______________________________________________
Discuss-gnustep mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnustep


_______________________________________________
Gnustep-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/gnustep-dev


--
Luboš Doležel



reply via email to

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