discuss-gnustep
[Top][All Lists]
Advanced

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

Re: GWorkspace Segfault


From: Fred Kiefer
Subject: Re: GWorkspace Segfault
Date: Tue, 19 Nov 2013 23:43:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

Could you please share the whole stack trace? Maybe I understand the
issue a little bit better then.

>From looking at the code in FSNBrowserCell I can tell that the value of
dtslenght never gets used. Why is it computed at all? And why in the
+initialize method? At that point in time the initialisation of the
backend might not be completed, which could be the reason for the
segmentation fault.

There is similar code in FSNTextCell, which at least treats this value
as a per object one, although it again is never used. I think this is
left over code that should be removed. And the actual shortening code
between these two classes should be reused, maybe moved into gui?

Fred



On 19.11.2013 13:09, Riccardo Mottola wrote:
> Hi Edwin.
> 
> from the stacktrace you provided, teh relevant part is this:
> 
> #0  -[NSString(NSStringDrawing)
> boundingRectWithSize:options:attributes:] (self=0xb7fdfad8
> <.objc_str476>, _cmd=0xb7e0d040 <.objc_selector_list+240>,
>     size=..., options=NSStringDrawingUsesLineFragmentOrigin,
> attrs=0x8a723c8) at NSStringDrawing.m:683
> #1  0xb7b7430e in -[NSString(NSStringDrawing) sizeWithAttributes:]
> (self=0xb7fdfad8 <.objc_str476>, _cmd=0xb7fdfb80 <.objc_selector_list+144>,
>     attrs=0x8a723c8) at NSStringDrawing.m:673
> #2  0xb7f6824f in +[FSNBrowserCell initialize] (self=0xb7fdfa40
> <_OBJC_CLASS_FSNBrowserCell>, _cmd=0x8223d40) at FSNBrowserCell.m:87
> 
> 
> 
> I'm unsure what is happening here. Either fontAttr is returning
> soemthing  null and you are on a platform where getting .width out of
> null generates a stacktrace, but that would be typical of sparc, not x86.
> 
> The second question is however how that could  happen.
> 
>       fontAttr = [NSDictionary dictionaryWithObject: [NSFont
> systemFontOfSize: 12]
>                                              forKey: NSFontAttributeName];
> 
> Should always return soemthing meaningful, I suppose? It's asking for
> the size 12 system font, something extremely standard!
> 
> Could you put a breakpoint there and print fontAttr?
> 
> 
> 
> Then it does:
> 
> dtslenght = [dots sizeWithAttributes: fontAttr].width;
> 
> where dots is a:
> static NSString *dots = @"...";
> 
> which looks quite reasonable for me. A static string, no fancy characters.
> 
> Riccardo




reply via email to

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