[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: art backend : NSView crashes
From: |
Fred Kiefer |
Subject: |
Re: art backend : NSView crashes |
Date: |
Fri, 1 May 2015 00:11:30 +0200 |
Looks like gcc 4.9 has gotten very strict about method calls on nil that return
a structure. It has always been better to check that case, but now it has
become a must.
Fred
On the road
Am 30.04.2015 um 23:42 schrieb Riccardo Mottola <riccardo.mottola@libero.it>:
> Hi,
>
> Fred Kiefer wrote:
>> Where does this new crash come from? Does it give you a better stack trace?
>
> I tried hard, I cannot reoproduce this on on another computer. On the
> problematic computer (Gentoo linux, x86/32, libart 2.3.21 gcc 4.9.2)
>
> - no optimizations (-g -O0) to compile PRICE -> no crash
> - -g -O1 or -O2, I get a useless trace:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xbfffcb89 in ?? ()
> (gdb) bt
> #0 0xbfffcb89 in ?? ()
> #1 0x00000000 in ?? ()
>
> I think it is totally unrelated to GUI and BACK.
> PRICE's PRWindowController gets a notification and has this line:
>
> imgSize = [[[self document] activeImage] pixelSize];
>
> this causes the crash. Supposing activeImage is nil, what pixelSize will I
> get?
> Accessing a method on a nil object? and if that method doesn't return an
> object but a struct?
>
> I know that on SPARC accessing members of a NULL struct causes problems, but
> the above?
>
>
> I substituted the code with this:
>
> img = [[self document] activeImage];
> imgSize = NSZeroSize;
> if (img)
> imgSize = [img pixelSize];
>
> and it works fine. What do you think?
>
> Riccardo
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep
- art backend : NSView crashes, Riccardo Mottola, 2015/04/11
- Re: art backend : NSView crashes, Riccardo Mottola, 2015/04/12
- Re: art backend : NSView crashes, Riccardo Mottola, 2015/04/12
- Re: art backend : NSView crashes, Stefan Bidigaray, 2015/04/14
- Re: art backend : NSView crashes, Fred Kiefer, 2015/04/28
- Re: art backend : NSView crashes, Riccardo Mottola, 2015/04/29
- Re: art backend : NSView crashes, Riccardo Mottola, 2015/04/30
- Re: art backend : NSView crashes, Riccardo Mottola, 2015/04/30
- Re: art backend : NSView crashes,
Fred Kiefer <=