[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Base NSScanner/GSFormat issues - segmentation fault
From: |
Fred Kiefer |
Subject: |
Re: Base NSScanner/GSFormat issues - segmentation fault |
Date: |
Mon, 16 Dec 2019 15:11:41 +0100 |
> Am 16.12.2019 um 11:44 schrieb Riccardo Mottola <address@hidden>:
>
> on a very plain Linux i386 32bit setup, configured with clang, libobjc2 and
> ng-gnu-gnu runtime I always had issues with almost everything crashing, this
> is months old (years?).
>
> What happens is this:
> Program received signal SIGSEGV, Segmentation fault.
> 0xb757a078 in myGetC (c=<optimized out>) at NSScanner.m:91
> 91 (void)GSToUnicode(&dst, &size, &c, 1, internalEncoding, 0, 0);
>
>
> Here a Trace.
> #0 0xb757a078 in myGetC (c=<optimized out>) at NSScanner.m:91
> #1 -[NSScanner scanDouble:] (self=<optimized out>, _cmd=<optimized out>,
> value=<optimized out>) at NSScanner.m:823
> #2 0xb7ba9056 in +[NSColor(GNUstepPrivate) colorFromString:]
> (self=<optimized out>, _cmd=<optimized out>,
> str=<optimized out>) at NSColor.m:1810
> #3 0xb7ba5166 in initSystemColors () at NSColor.m:277
> #4 +[NSColor initialize] (self=<optimized out>, _cmd=<optimized out>) at
> NSColor.m:328
> #5 0xb7291c58 in objc_send_initialize () from
> /System/Library/Libraries/libobjc.so.4.6
> #6 0xb729db58 in slowMsgLookup () from
> /System/Library/Libraries/libobjc.so.4.6
> #7 0xb72a3b11 in objc_msgSend () from
> /System/Library/Libraries/libobjc.so.4.6
> #8 0xb7be61d0 in +[NSImage initialize] (self=<optimized out>,
> _cmd=<optimized out>) at NSImage.m:451
> #9 0xb7291c58 in objc_send_initialize () from
> /System/Library/Libraries/libobjc.so.4.6
> #10 0xb729db58 in slowMsgLookup () from
> /System/Library/Libraries/libobjc.so.4.6
> #11 0xb72a3b11 in objc_msgSend () from
> /System/Library/Libraries/libobjc.so.4.6
> #12 0xb7bbce88 in getStandardCursor (name=<optimized out>, style=<optimized
> out>) at NSCursor.m:183
> #13 0xb7bbcdad in +[NSCursor arrowCursor] (self=0x817d260, _cmd=0xb7ec7174
> <objc_selector_list+32>) at NSCursor.m:201
> #14 0xb7bbcaec in +[NSCursor initialize] (self=0x817d260, _cmd=0x8090918) at
> NSCursor.m:69
> #15 0xb7291c58 in objc_send_initialize () from
> /System/Library/Libraries/libobjc.so.4.6
> #16 0xb729db58 in slowMsgLookup () from
> /System/Library/Libraries/libobjc.so.4.6
> #17 0xb72a3b11 in objc_msgSend () from
> /System/Library/Libraries/libobjc.so.4.6
> #18 0xb43992d8 in -[XGServer(WindowOps) _initializeCursorForXWindow:]
> (self=<optimized out>, _cmd=<optimized out>,
> win=<optimized out>) at XGServerWindow.m:3980
> #19 0xb4391ea0 in -[XGServer(WindowOps) _checkStyle:] (self=<optimized out>,
> _cmd=<optimized out>,
> style=<optimized out>) at XGServerWindow.m:931
> #20 0xb4393a34 in -[XGServer(WindowOps) _setupRootWindow] (self=<optimized
> out>, _cmd=<optimized out>)
> at XGServerWindow.m:1659
> #21 0xb4389ef6 in -[XGServer _initXContext] (self=<optimized out>,
> _cmd=<optimized out>) at XGServer.m:465
> #22 0xb4389fe8 in -[XGServer initWithAttributes:] (self=<optimized out>,
> _cmd=<optimized out>, info=<optimized out>)
> at XGServer.m:478
> #23 0xb7cd0c44 in +[GSDisplayServer serverWithAttributes:] (self=<optimized
> out>, _cmd=<optimized out>,
> attributes=<optimized out>) at GSDisplayServer.m:181
> #24 0xb7b65a8f in -[NSApplication _init] (self=0x83be414, _cmd=0xb7ea0b50
> <objc_selector_list+32>)
> at NSApplication.m:892
> #25 0xb753cc13 in -[NSObject performSelector:withObject:] (self=<optimized
> out>, _cmd=<optimized out>,
> aSelector=<optimized out>, anObject=<optimized out>) at NSObject.m:2024
>
>
>
> For a long time I worked around this by removing optimization, the minimum
> was this in base:
>
> GSFormat.m_FILE_FILTER_OUT_FLAGS = -O%
>
> Now... this hack stopped working for me, GNUstep is "broken".
> In the meanwhile, I also updated the compiler. it is cloang 8.0.1, no longer
> clang 6. I hope that if there was some strange compiler bug, it should have
> been gone.
>
> So I start fearing that we have some bad code, but it happens "only" in this
> setup I have. Any suggestion?
To me this sounds like a compiler issue. The best you can do is get clang to
create assembler output (-S for gcc, most likely it is the same) and pass the
result for this small function on to David. As a workaround you may try to
extend your little hack to cover NSScanner.m as well. That is:
NSScanner.m_FILE_FILTER_OUT_FLAGS = -O%
Hope this helps,
Fred