gui apps segfault on Linux/x86/clang/libobjc2

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

gui apps segfault on Linux/x86/clang/libobjc2

Riccardo Mottola-5
Hi,

on plain Linux/x86, using clang, a simple gui app like Ink fails to start:

Program received signal SIGSEGV, Segmentation fault.
0xb3ecb101 in xcb_writev () from /usr/lib/libxcb.so.1
(gdb) bt
#0  0xb3ecb101 in xcb_writev () from /usr/lib/libxcb.so.1
#1  0xb40653ce in _XSend () from /usr/lib/libX11.so.6
#2  0xb40659c1 in _XReply () from /usr/lib/libX11.so.6
#3  0xb404b45e in XGetWindowProperty () from /usr/lib/libX11.so.6
#4  0xb404a253 in XGetIconSizes () from /usr/lib/libX11.so.6
#5  0xb443ba49 in -[XGServer(WindowOps) iconSize] (self=0x8434cd4,
_cmd=0xb7f74b18 <.objc_selector_list+64>)
     at XGServerWindow.m:4565
#6  0xb7d418ce in GSGetIconSize () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#7  0xb7a56180 in +[NSAppIconView initialize] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#8  0xb714015c in objc_send_initialize () from
/System/Library/Libraries/libobjc.so.4.6
#9  0xb714c4d8 in slowMsgLookup () from
/System/Library/Libraries/libobjc.so.4.6
#10 0xb71525e1 in objc_msgSend () from
/System/Library/Libraries/libobjc.so.4.6
#11 0xb7a6243d in -[NSApplication(Private) _appIconInit] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#12 0xb7a57e3b in -[NSApplication _init] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#13 0xb74551a2 in -[NSObject performSelector:withObject:] () from
/System/Library/Libraries/libgnustep-base.so.1.25
#14 0xb74eb575 in -[NSObject(NSThreadPerformAdditions)
performSelector:onThread:withObject:waitUntilDone:modes:] ()
    from /System/Library/Libraries/libgnustep-base.so.1.25
#15 0xb74eb1ef in -[NSObject(NSThreadPerformAdditions)
performSelectorOnMainThread:withObject:waitUntilDone:modes:] ()
    from /System/Library/Libraries/libgnustep-base.so.1.25
#16 0xb74eb294 in -[NSObject(NSThreadPerformAdditions)
performSelectorOnMainThread:withObject:waitUntilDone:] ()
    from /System/Library/Libraries/libgnustep-base.so.1.25
#17 0xb7a58220 in -[NSApplication init] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#18 0xb7a579bf in +[NSApplication sharedApplication] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#19 0xb7a2c6f5 in NSApplicationMain () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#20 0x0804aae0 in main (argc=<optimized out>, argv=<optimized out>,
env=<optimized out>) at main.m:33

I somehow have a de-ja-vu about iconsize, but it was fixed by Wolfgang
Months ago!

What's wrong??

Riccardo

_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: gui apps segfault on Linux/x86/clang/libobjc2

Fred Kiefer
Hi Riccardo,

my advise is as always, run this application under valgrind and let it figure out what is going wrong here. As the issue itself is happening somewhere inside of libX11 it is highly likely that this isn’t a GNUstep problem.

Cheers
Fred

> Am 30.11.2018 um 00:45 schrieb Riccardo Mottola <[hidden email]>:
>
> Hi,
>
> on plain Linux/x86, using clang, a simple gui app like Ink fails to start:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xb3ecb101 in xcb_writev () from /usr/lib/libxcb.so.1
> (gdb) bt
> #0  0xb3ecb101 in xcb_writev () from /usr/lib/libxcb.so.1
> #1  0xb40653ce in _XSend () from /usr/lib/libX11.so.6
> #2  0xb40659c1 in _XReply () from /usr/lib/libX11.so.6
> #3  0xb404b45e in XGetWindowProperty () from /usr/lib/libX11.so.6
> #4  0xb404a253 in XGetIconSizes () from /usr/lib/libX11.so.6
> #5  0xb443ba49 in -[XGServer(WindowOps) iconSize] (self=0x8434cd4, _cmd=0xb7f74b18 <.objc_selector_list+64>)
>    at XGServerWindow.m:4565
> #6  0xb7d418ce in GSGetIconSize () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #7  0xb7a56180 in +[NSAppIconView initialize] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #8  0xb714015c in objc_send_initialize () from /System/Library/Libraries/libobjc.so.4.6
> #9  0xb714c4d8 in slowMsgLookup () from /System/Library/Libraries/libobjc.so.4.6
> #10 0xb71525e1 in objc_msgSend () from /System/Library/Libraries/libobjc.so.4.6
> #11 0xb7a6243d in -[NSApplication(Private) _appIconInit] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #12 0xb7a57e3b in -[NSApplication _init] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #13 0xb74551a2 in -[NSObject performSelector:withObject:] () from /System/Library/Libraries/libgnustep-base.so.1.25
> #14 0xb74eb575 in -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] ()
>   from /System/Library/Libraries/libgnustep-base.so.1.25
> #15 0xb74eb1ef in -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:modes:] ()
>   from /System/Library/Libraries/libgnustep-base.so.1.25
> #16 0xb74eb294 in -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] ()
>   from /System/Library/Libraries/libgnustep-base.so.1.25
> #17 0xb7a58220 in -[NSApplication init] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #18 0xb7a579bf in +[NSApplication sharedApplication] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #19 0xb7a2c6f5 in NSApplicationMain () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #20 0x0804aae0 in main (argc=<optimized out>, argv=<optimized out>, env=<optimized out>) at main.m:33
>
> I somehow have a de-ja-vu about iconsize, but it was fixed by Wolfgang Months ago!
>
> What's wrong??
>
> Riccardo
>
> _______________________________________________
> Discuss-gnustep mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: gui apps segfault on Linux/x86/clang/libobjc2

Richard Frith-Macdonald-9
In reply to this post by Riccardo Mottola-5
> On 29 Nov 2018, at 23:45, Riccardo Mottola <[hidden email]> wrote:
>
> Hi,
>
> on plain Linux/x86, using clang, a simple gui app like Ink fails to start:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xb3ecb101 in xcb_writev () from /usr/lib/libxcb.so.1
> (gdb) bt
> #0  0xb3ecb101 in xcb_writev () from /usr/lib/libxcb.so.1
> #1  0xb40653ce in _XSend () from /usr/lib/libX11.so.6
> #2  0xb40659c1 in _XReply () from /usr/lib/libX11.so.6
> #3  0xb404b45e in XGetWindowProperty () from /usr/lib/libX11.so.6
> #4  0xb404a253 in XGetIconSizes () from /usr/lib/libX11.so.6
> #5  0xb443ba49 in -[XGServer(WindowOps) iconSize] (self=0x8434cd4, _cmd=0xb7f74b18 <.objc_selector_list+64>)
>    at XGServerWindow.m:4565
> #6  0xb7d418ce in GSGetIconSize () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #7  0xb7a56180 in +[NSAppIconView initialize] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #8  0xb714015c in objc_send_initialize () from /System/Library/Libraries/libobjc.so.4.6
> #9  0xb714c4d8 in slowMsgLookup () from /System/Library/Libraries/libobjc.so.4.6
> #10 0xb71525e1 in objc_msgSend () from /System/Library/Libraries/libobjc.so.4.6
> #11 0xb7a6243d in -[NSApplication(Private) _appIconInit] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #12 0xb7a57e3b in -[NSApplication _init] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #13 0xb74551a2 in -[NSObject performSelector:withObject:] () from /System/Library/Libraries/libgnustep-base.so.1.25
> #14 0xb74eb575 in -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] ()
>   from /System/Library/Libraries/libgnustep-base.so.1.25
> #15 0xb74eb1ef in -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:modes:] ()
>   from /System/Library/Libraries/libgnustep-base.so.1.25
> #16 0xb74eb294 in -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] ()
>   from /System/Library/Libraries/libgnustep-base.so.1.25
> #17 0xb7a58220 in -[NSApplication init] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #18 0xb7a579bf in +[NSApplication sharedApplication] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #19 0xb7a2c6f5 in NSApplicationMain () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #20 0x0804aae0 in main (argc=<optimized out>, argv=<optimized out>, env=<optimized out>) at main.m:33
>
> I somehow have a de-ja-vu about iconsize, but it was fixed by Wolfgang Months ago!
>
> What's wrong??

Segmentation fault inside the X code. not in the GNUstep code.

That (assuming it's not an X bug), suggests corrupt memory or something like that.  Possibly a memory error in GNUstep code, possibly incorrect/multiple library versions linked in to the binary (eg the main executable and a bundle having different versions of the same library linked).

I'd suggest valgrind to look form emory corruption and looking at all the libraries linked to the executables/bindles in use (though rebuilding *everything* from scratrch will usually fix library version issues).
_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: gui apps segfault on Linux/x86/clang/libobjc2

Riccardo Mottola-5
In reply to this post by Fred Kiefer
Hoi,

Fred Kiefer wrote:
> my advise is as always, run this application under valgrind and let it figure out what is going wrong here. As the issue itself is happening somewhere inside of libX11 it is highly likely that this isn’t a GNUstep problem.


following yours and Richard advice, I unintalled, cleaned and rebuild
all core libraries and Ink, lowering also the optimization level.

Ink still segfaults at startup, but with valgrind it starts.

There seem to be several issues, both in gui/back as one in base or
GWorkspace (?)
Explanations or ideas?
Suggestions and patches welcome!

Riccardo

2018-12-02 09:57:55.504 Ink[21797:21797] styleoffsets ... guessing offsets
==21797== Source and destination overlap in memcpy(0x902ded8, 0x902ded8, 28)
==21797==    at 0x4035409: __GI_memcpy (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==21797==    by 0x7F0B2F1: _i_GSGState__setColor_state_ (in
/System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
==21797==    by 0x7F0E6C4: _i_GSGState_Ops_DPSinitgraphics (in
/System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
==21797==    by 0x7F5AE2B: _i_CairoGState__DPSinitgraphics (in
/System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
==21797==    by 0x7F0AB03: _i_GSGState__initWithDrawContext_ (in
/System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
==21797==    by 0x7F0410A: _i_GSContext__initWithContextInfo_ (in
/System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
==21797==    by 0x43A901A:
_c_NSGraphicsContext__graphicsContextWithAttributes_ (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x42C7D74: _i_NSApplication___init (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x4AFC231: _i_NSObject__performSelector_withObject_ (in
/System/Library/Libraries/libgnustep-base.so.1.25.1)
==21797==    by 0x4B92674:
_i_NSObject_NSThreadPerformAdditions_performSelector_onThread_withObject_waitUntilDone_modes_
(in /System/Library/Libraries/libgnustep-base.so.1.25.1)
==21797==    by 0x4B922EB:
_i_NSObject_NSThreadPerformAdditions_performSelectorOnMainThread_withObject_waitUntilDone_modes_
(in /System/Library/Libraries/libgnustep-base.so.1.25.1)
==21797==    by 0x4B92390:
_i_NSObject_NSThreadPerformAdditions_performSelectorOnMainThread_withObject_waitUntilDone_
(in /System/Library/Libraries/libgnustep-base.so.1.25.1)
==21797==
==21797== Source and destination overlap in memcpy(0x993c300, 0x993c300, 28)
==21797==    at 0x4035409: __GI_memcpy (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==21797==    by 0x7F0B2F1: _i_GSGState__setColor_state_ (in
/System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
==21797==    by 0x7F0BF21: _i_GSGState_Ops_DPSsetalpha_ (in
/System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
==21797==    by 0x7F04E1F: _i_GSContext_Ops_DPSsetalpha_ (in
/System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
==21797==    by 0x434A74C: DPSsetalpha (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x4344ADC: PSsetalpha (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x43480E0: _i_GSRGBColor__set (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x4340019: _i_NSColor__set (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x45C56BA: _i_GSTheme_Drawing_drawWindowBackground_view_
(in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x45FD4F4: _i_GSWindowDecorationView__drawRect_ (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x45292E8:
_i_NSView__displayRectIgnoringOpacity_inContext_ (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x4528E4E: _i_NSView__displayRectIgnoringOpacity_ (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==
==21797== Source and destination overlap in memcpy(0x993c31c, 0x993c31c, 28)
==21797==    at 0x4035409: __GI_memcpy (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==21797==    by 0x7F0B333: _i_GSGState__setColor_state_ (in
/System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
==21797==    by 0x7F0BF64: _i_GSGState_Ops_DPSsetalpha_ (in
/System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
==21797==    by 0x7F04E1F: _i_GSContext_Ops_DPSsetalpha_ (in
/System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
==21797==    by 0x434A74C: DPSsetalpha (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x4344ADC: PSsetalpha (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x43480E0: _i_GSRGBColor__set (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x4340019: _i_NSColor__set (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x45C56BA: _i_GSTheme_Drawing_drawWindowBackground_view_
(in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x45FD4F4: _i_GSWindowDecorationView__drawRect_ (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x45292E8:
_i_NSView__displayRectIgnoringOpacity_inContext_ (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x4528E4E: _i_NSView__displayRectIgnoringOpacity_ (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==
==21797== Source and destination overlap in memcpy(0x9e67c28, 0x9e67c28, 24)
==21797==    at 0x4035409: __GI_memcpy (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==21797==    by 0x4C1224C:
_i_GSFFIInvocation__initWithCallback_values_frame_signature_ (in
/System/Library/Libraries/libgnustep-base.so.1.25.1)
==21797==    by 0x4C1359A: GSFFIInvocationCallback (in
/System/Library/Libraries/libgnustep-base.so.1.25.1)
==21797==    by 0x7566A74: ??? (in /usr/lib/libffi.so.6.0.4)
==21797==    by 0x7566E25: ??? (in /usr/lib/libffi.so.6.0.4)
==21797==    by 0x4A776EA:
_i_NSDistributedNotificationCenter_Private__connect (in
/System/Library/Libraries/libgnustep-base.so.1.25.1)
==21797==    by 0x4A75C22:
_i_NSDistributedNotificationCenter__addObserver_selector_name_object_suspensionBehavior_
(in /System/Library/Libraries/libgnustep-base.so.1.25.1)
==21797==    by 0x4A7592D:
_i_NSDistributedNotificationCenter__addObserver_selector_name_object_
(in /System/Library/Libraries/libgnustep-base.so.1.25.1)
==21797==    by 0x4558336: _i__GSWorkspaceCenter__init (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x4AFACCA: _c_NSObject__new (in
/System/Library/Libraries/libgnustep-base.so.1.25.1)
==21797==    by 0x455A2C4: _i_NSWorkspace__init (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==    by 0x455A06B: _c_NSWorkspace__sharedWorkspace (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==21797==
==21797==
==21797== HEAP SUMMARY:
==21797==     in use at exit: 6,861,498 bytes in 64,833 blocks
==21797==   total heap usage: 142,607 allocs, 77,774 frees, 17,768,720
bytes allocated
==21797==
==21797== LEAK SUMMARY:
==21797==    definitely lost: 429,650 bytes in 9,115 blocks
==21797==    indirectly lost: 33,558 bytes in 2,010 blocks
==21797==      possibly lost: 1,486,526 bytes in 13,515 blocks
==21797==    still reachable: 4,911,764 bytes in 40,193 blocks
==21797==                       of which reachable via heuristic:
==21797==                         newarray           : 44,142 bytes in
1,433 blocks
==21797==         suppressed: 0 bytes in 0 blocks
==21797== Rerun with --leak-check=full to see details of leaked memory
==21797==
==21797== For counts of detected and suppressed errors, rerun with: -v
==21797== ERROR SUMMARY: 902 errors from 4 contexts (suppressed: 1 from 1)

_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: gui apps segfault on Linux/x86/clang/libobjc2

Fred Kiefer
Both the reported issues should be rather harmless. For the one in back I already committed a fix to prevent it. Please try with the current version on git.
I will look into the base issue as well, but expect that this is also not the cause of your problem. It is far more interesting that you get the segmentation fault only when not running with valgrind. Is the stack trace of the segmentation fault still the same?

Fred


> Am 02.12.2018 um 10:11 schrieb Riccardo Mottola <[hidden email]>:
>
> Fred Kiefer wrote:
>> my advise is as always, run this application under valgrind and let it figure out what is going wrong here. As the issue itself is happening somewhere inside of libX11 it is highly likely that this isn’t a GNUstep problem.
>
>
> following yours and Richard advice, I unintalled, cleaned and rebuild all core libraries and Ink, lowering also the optimization level.
>
> Ink still segfaults at startup, but with valgrind it starts.
>
> There seem to be several issues, both in gui/back as one in base or GWorkspace (?)
> Explanations or ideas?
> Suggestions and patches welcome!
>
> Riccardo
>
> 2018-12-02 09:57:55.504 Ink[21797:21797] styleoffsets ... guessing offsets
> ==21797== Source and destination overlap in memcpy(0x902ded8, 0x902ded8, 28)
> ==21797==    at 0x4035409: __GI_memcpy (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
> ==21797==    by 0x7F0B2F1: _i_GSGState__setColor_state_ (in /System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
> ==21797==    by 0x7F0E6C4: _i_GSGState_Ops_DPSinitgraphics (in /System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
> ==21797==    by 0x7F5AE2B: _i_CairoGState__DPSinitgraphics (in /System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
> ==21797==    by 0x7F0AB03: _i_GSGState__initWithDrawContext_ (in /System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
> ==21797==    by 0x7F0410A: _i_GSContext__initWithContextInfo_ (in /System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
> ==21797==    by 0x43A901A: _c_NSGraphicsContext__graphicsContextWithAttributes_ (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x42C7D74: _i_NSApplication___init (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x4AFC231: _i_NSObject__performSelector_withObject_ (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==21797==    by 0x4B92674: _i_NSObject_NSThreadPerformAdditions_performSelector_onThread_withObject_waitUntilDone_modes_ (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==21797==    by 0x4B922EB: _i_NSObject_NSThreadPerformAdditions_performSelectorOnMainThread_withObject_waitUntilDone_modes_ (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==21797==    by 0x4B92390: _i_NSObject_NSThreadPerformAdditions_performSelectorOnMainThread_withObject_waitUntilDone_ (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==21797==
> ==21797== Source and destination overlap in memcpy(0x993c300, 0x993c300, 28)
> ==21797==    at 0x4035409: __GI_memcpy (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
> ==21797==    by 0x7F0B2F1: _i_GSGState__setColor_state_ (in /System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
> ==21797==    by 0x7F0BF21: _i_GSGState_Ops_DPSsetalpha_ (in /System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
> ==21797==    by 0x7F04E1F: _i_GSContext_Ops_DPSsetalpha_ (in /System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
> ==21797==    by 0x434A74C: DPSsetalpha (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x4344ADC: PSsetalpha (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x43480E0: _i_GSRGBColor__set (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x4340019: _i_NSColor__set (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x45C56BA: _i_GSTheme_Drawing_drawWindowBackground_view_ (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x45FD4F4: _i_GSWindowDecorationView__drawRect_ (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x45292E8: _i_NSView__displayRectIgnoringOpacity_inContext_ (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x4528E4E: _i_NSView__displayRectIgnoringOpacity_ (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==
> ==21797== Source and destination overlap in memcpy(0x993c31c, 0x993c31c, 28)
> ==21797==    at 0x4035409: __GI_memcpy (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
> ==21797==    by 0x7F0B333: _i_GSGState__setColor_state_ (in /System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
> ==21797==    by 0x7F0BF64: _i_GSGState_Ops_DPSsetalpha_ (in /System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
> ==21797==    by 0x7F04E1F: _i_GSContext_Ops_DPSsetalpha_ (in /System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026)
> ==21797==    by 0x434A74C: DPSsetalpha (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x4344ADC: PSsetalpha (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x43480E0: _i_GSRGBColor__set (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x4340019: _i_NSColor__set (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x45C56BA: _i_GSTheme_Drawing_drawWindowBackground_view_ (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x45FD4F4: _i_GSWindowDecorationView__drawRect_ (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x45292E8: _i_NSView__displayRectIgnoringOpacity_inContext_ (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x4528E4E: _i_NSView__displayRectIgnoringOpacity_ (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==
> ==21797== Source and destination overlap in memcpy(0x9e67c28, 0x9e67c28, 24)
> ==21797==    at 0x4035409: __GI_memcpy (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
> ==21797==    by 0x4C1224C: _i_GSFFIInvocation__initWithCallback_values_frame_signature_ (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==21797==    by 0x4C1359A: GSFFIInvocationCallback (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==21797==    by 0x7566A74: ??? (in /usr/lib/libffi.so.6.0.4)
> ==21797==    by 0x7566E25: ??? (in /usr/lib/libffi.so.6.0.4)
> ==21797==    by 0x4A776EA: _i_NSDistributedNotificationCenter_Private__connect (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==21797==    by 0x4A75C22: _i_NSDistributedNotificationCenter__addObserver_selector_name_object_suspensionBehavior_ (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==21797==    by 0x4A7592D: _i_NSDistributedNotificationCenter__addObserver_selector_name_object_ (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==21797==    by 0x4558336: _i__GSWorkspaceCenter__init (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x4AFACCA: _c_NSObject__new (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==21797==    by 0x455A2C4: _i_NSWorkspace__init (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==    by 0x455A06B: _c_NSWorkspace__sharedWorkspace (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==21797==
> ==21797==
> ==21797== HEAP SUMMARY:
> ==21797==     in use at exit: 6,861,498 bytes in 64,833 blocks
> ==21797==   total heap usage: 142,607 allocs, 77,774 frees, 17,768,720 bytes allocated
> ==21797==
> ==21797== LEAK SUMMARY:
> ==21797==    definitely lost: 429,650 bytes in 9,115 blocks
> ==21797==    indirectly lost: 33,558 bytes in 2,010 blocks
> ==21797==      possibly lost: 1,486,526 bytes in 13,515 blocks
> ==21797==    still reachable: 4,911,764 bytes in 40,193 blocks
> ==21797==                       of which reachable via heuristic:
> ==21797==                         newarray           : 44,142 bytes in 1,433 blocks
> ==21797==         suppressed: 0 bytes in 0 blocks
> ==21797== Rerun with --leak-check=full to see details of leaked memory
> ==21797==
> ==21797== For counts of detected and suppressed errors, rerun with: -v
> ==21797== ERROR SUMMARY: 902 errors from 4 contexts (suppressed: 1 from 1)


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: gui apps segfault on Linux/x86/clang/libobjc2

Riccardo Mottola-5
Hi Fred,

I would rather not point the bug into xcb or X11, other non-gnustep apps
do work fine, including sensitive apps like Firefox and emacs.

Fred Kiefer wrote:
> Both the reported issues should be rather harmless. For the one in back I already committed a fix to prevent it. Please try with the current version on git.

INdeed, updating back makes the error go away in valgrind (but... not
the segfault)

> I will look into the base issue as well, but expect that this is also not the cause of your problem. It is far more interesting that you get the segmentation fault only when not running with valgrind. Is the stack trace of the segmentation fault still the same?

"interesting" but what does it tell us? Valgrind is preventing some
memory damage: It is a matter of Heiseberg, trying to measure modifies
the object of measure! It may happen with gdb too, but not in this case.

==9086== Source and destination overlap in memcpy(0x9e68c18, 0x9e68c18, 24)
==9086==    at 0x4035409: __GI_memcpy (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==9086==    by 0x4C1224C:
_i_GSFFIInvocation__initWithCallback_values_frame_signature_ (in
/System/Library/Libraries/libgnustep-base.so.1.25.1)
==9086==    by 0x4C1359A: GSFFIInvocationCallback (in
/System/Library/Libraries/libgnustep-base.so.1.25.1)
==9086==    by 0x7566A74: ??? (in /usr/lib/libffi.so.6.0.4)
==9086==    by 0x7566E25: ??? (in /usr/lib/libffi.so.6.0.4)
==9086==    by 0x4A776EA:
_i_NSDistributedNotificationCenter_Private__connect (in
/System/Library/Libraries/libgnustep-base.so.1.25.1)
==9086==    by 0x4A75C22:
_i_NSDistributedNotificationCenter__addObserver_selector_name_object_suspensionBehavior_
(in /System/Library/Libraries/libgnustep-base.so.1.25.1)
==9086==    by 0x4A7592D:
_i_NSDistributedNotificationCenter__addObserver_selector_name_object_
(in /System/Library/Libraries/libgnustep-base.so.1.25.1)
==9086==    by 0x4558336: _i__GSWorkspaceCenter__init (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==9086==    by 0x4AFACCA: _c_NSObject__new (in
/System/Library/Libraries/libgnustep-base.so.1.25.1)
==9086==    by 0x455A2C4: _i_NSWorkspace__init (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==9086==    by 0x455A06B: _c_NSWorkspace__sharedWorkspace (in
/System/Library/Libraries/libgnustep-gui.so.0.26.2)
==9086==
2018-12-02 15:06:56.370 Ink[9086:9086] Unable to contact pasteboard
server - please ensure that gpbs is running for local host.
2018-12-02 15:07:09.316 Ink[9086:9086] Unable to contact pasteboard
server - please ensure that gpbs is running for local host.
==9086==
==9086== HEAP SUMMARY:
==9086==     in use at exit: 7,056,137 bytes in 65,574 blocks
==9086==   total heap usage: 224,958 allocs, 159,384 frees, 24,190,943
bytes allocated
==9086==
==9086== LEAK SUMMARY:
==9086==    definitely lost: 429,675 bytes in 9,125 blocks
==9086==    indirectly lost: 21,386 bytes in 1,258 blocks
==9086==      possibly lost: 1,589,835 bytes in 14,925 blocks
==9086==    still reachable: 5,015,241 bytes in 40,266 blocks
==9086==                       of which reachable via heuristic:
==9086==                         newarray           : 46,317 bytes in
1,466 blocks
==9086==         suppressed: 0 bytes in 0 blocks
==9086== Rerun with --leak-check=full to see details of leaked memory
==9086==
==9086== For counts of detected and suppressed errors, rerun with: -v
==9086== ERROR SUMMARY: 10 errors from 1 contexts (suppressed: 1 from 1)


Program received signal SIGSEGV, Segmentation fault.
0xb3ead101 in xcb_writev () from /usr/lib/libxcb.so.1
(gdb) bt
#0  0xb3ead101 in xcb_writev () from /usr/lib/libxcb.so.1
#1  0xb40473ce in _XSend () from /usr/lib/libX11.so.6
#2  0xb40479c1 in _XReply () from /usr/lib/libX11.so.6
#3  0xb402d45e in XGetWindowProperty () from /usr/lib/libX11.so.6
#4  0xb402c253 in XGetIconSizes () from /usr/lib/libX11.so.6
#5  0xb4438452 in -[XGServer(WindowOps) iconSize] () from
/System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026
#6  0xb7d418fe in GSGetIconSize () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#7  0xb7a56380 in +[NSAppIconView initialize] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#8  0xb714015c in objc_send_initialize () from
/System/Library/Libraries/libobjc.so.4.6
#9  0xb714c4d8 in slowMsgLookup () from
/System/Library/Libraries/libobjc.so.4.6
#10 0xb71525e1 in objc_msgSend () from
/System/Library/Libraries/libobjc.so.4.6
#11 0xb7a626cd in -[NSApplication(Private) _appIconInit] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#12 0xb7a58041 in -[NSApplication _init] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#13 0xb7455232 in -[NSObject performSelector:withObject:] () from
/System/Library/Libraries/libgnustep-base.so.1.25
#14 0xb74eb675 in -[NSObject(NSThreadPerformAdditions)
performSelector:onThread:withObject:waitUntilDone:modes:] ()
    from /System/Library/Libraries/libgnustep-base.so.1.25
#15 0xb74eb2ec in -[NSObject(NSThreadPerformAdditions)
performSelectorOnMainThread:withObject:waitUntilDone:modes:] ()
    from /System/Library/Libraries/libgnustep-base.so.1.25
#16 0xb74eb391 in -[NSObject(NSThreadPerformAdditions)
performSelectorOnMainThread:withObject:waitUntilDone:] ()
    from /System/Library/Libraries/libgnustep-base.so.1.25
#17 0xb7a58420 in -[NSApplication init] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#18 0xb7a57bbf in +[NSApplication sharedApplication] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#19 0xb7a2c6f2 in NSApplicationMain () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#20 0x0804ab52 in main ()


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: gui apps segfault on Linux/x86/clang/libobjc2

Fred Kiefer


> Am 02.12.2018 um 15:21 schrieb Riccardo Mottola <[hidden email]>:
>
> I would rather not point the bug into xcb or X11, other non-gnustep apps do work fine, including sensitive apps like Firefox and emacs.
>
> Fred Kiefer wrote:
>> Both the reported issues should be rather harmless. For the one in back I already committed a fix to prevent it. Please try with the current version on git.
>
> INdeed, updating back makes the error go away in valgrind (but... not the segfault)
>
>> I will look into the base issue as well, but expect that this is also not the cause of your problem. It is far more interesting that you get the segmentation fault only when not running with valgrind. Is the stack trace of the segmentation fault still the same?
>
> "interesting" but what does it tell us? Valgrind is preventing some memory damage: It is a matter of Heiseberg, trying to measure modifies the object of measure! It may happen with gdb too, but not in this case.

Yes, but this means that we are not accessing an uninitialised value here, as otherwise valgrind would detect it and complain.

> ==9086== Source and destination overlap in memcpy(0x9e68c18, 0x9e68c18, 24)
> ==9086==    at 0x4035409: __GI_memcpy (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
> ==9086==    by 0x4C1224C: _i_GSFFIInvocation__initWithCallback_values_frame_signature_ (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==9086==    by 0x4C1359A: GSFFIInvocationCallback (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==9086==    by 0x7566A74: ??? (in /usr/lib/libffi.so.6.0.4)
> ==9086==    by 0x7566E25: ??? (in /usr/lib/libffi.so.6.0.4)
> ==9086==    by 0x4A776EA: _i_NSDistributedNotificationCenter_Private__connect (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==9086==    by 0x4A75C22: _i_NSDistributedNotificationCenter__addObserver_selector_name_object_suspensionBehavior_ (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==9086==    by 0x4A7592D: _i_NSDistributedNotificationCenter__addObserver_selector_name_object_ (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==9086==    by 0x4558336: _i__GSWorkspaceCenter__init (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==9086==    by 0x4AFACCA: _c_NSObject__new (in /System/Library/Libraries/libgnustep-base.so.1.25.1)
> ==9086==    by 0x455A2C4: _i_NSWorkspace__init (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==9086==    by 0x455A06B: _c_NSWorkspace__sharedWorkspace (in /System/Library/Libraries/libgnustep-gui.so.0.26.2)
> ==9086==
> 2018-12-02 15:06:56.370 Ink[9086:9086] Unable to contact pasteboard server - please ensure that gpbs is running for local host.
> 2018-12-02 15:07:09.316 Ink[9086:9086] Unable to contact pasteboard server - please ensure that gpbs is running for local host.
> ==9086==
> ==9086== HEAP SUMMARY:
> ==9086==     in use at exit: 7,056,137 bytes in 65,574 blocks
> ==9086==   total heap usage: 224,958 allocs, 159,384 frees, 24,190,943 bytes allocated
> ==9086==
> ==9086== LEAK SUMMARY:
> ==9086==    definitely lost: 429,675 bytes in 9,125 blocks
> ==9086==    indirectly lost: 21,386 bytes in 1,258 blocks
> ==9086==      possibly lost: 1,589,835 bytes in 14,925 blocks
> ==9086==    still reachable: 5,015,241 bytes in 40,266 blocks
> ==9086==                       of which reachable via heuristic:
> ==9086==                         newarray           : 46,317 bytes in 1,466 blocks
> ==9086==         suppressed: 0 bytes in 0 blocks
> ==9086== Rerun with --leak-check=full to see details of leaked memory
> ==9086==
> ==9086== For counts of detected and suppressed errors, rerun with: -v
> ==9086== ERROR SUMMARY: 10 errors from 1 contexts (suppressed: 1 from 1)

As I wrote, I think that this is unrelated to your actual issue. As the problem doesn’t happen when running under valgrind, this tools is this time no big help. Although I will still suggest to use it as the first choice when ever you have a segmentation fault.


> Program received signal SIGSEGV, Segmentation fault.
> 0xb3ead101 in xcb_writev () from /usr/lib/libxcb.so.1
> (gdb) bt
> #0  0xb3ead101 in xcb_writev () from /usr/lib/libxcb.so.1
> #1  0xb40473ce in _XSend () from /usr/lib/libX11.so.6
> #2  0xb40479c1 in _XReply () from /usr/lib/libX11.so.6
> #3  0xb402d45e in XGetWindowProperty () from /usr/lib/libX11.so.6
> #4  0xb402c253 in XGetIconSizes () from /usr/lib/libX11.so.6
> #5  0xb4438452 in -[XGServer(WindowOps) iconSize] () from /System/Library/Bundles/libgnustep-back-026.bundle/libgnustep-back-026
> #6  0xb7d418fe in GSGetIconSize () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #7  0xb7a56380 in +[NSAppIconView initialize] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #8  0xb714015c in objc_send_initialize () from /System/Library/Libraries/libobjc.so.4.6
> #9  0xb714c4d8 in slowMsgLookup () from /System/Library/Libraries/libobjc.so.4.6
> #10 0xb71525e1 in objc_msgSend () from /System/Library/Libraries/libobjc.so.4.6
> #11 0xb7a626cd in -[NSApplication(Private) _appIconInit] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #12 0xb7a58041 in -[NSApplication _init] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #13 0xb7455232 in -[NSObject performSelector:withObject:] () from /System/Library/Libraries/libgnustep-base.so.1.25
> #14 0xb74eb675 in -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] ()
>   from /System/Library/Libraries/libgnustep-base.so.1.25
> #15 0xb74eb2ec in -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:modes:] ()
>   from /System/Library/Libraries/libgnustep-base.so.1.25
> #16 0xb74eb391 in -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] ()
>   from /System/Library/Libraries/libgnustep-base.so.1.25
> #17 0xb7a58420 in -[NSApplication init] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #18 0xb7a57bbf in +[NSApplication sharedApplication] () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #19 0xb7a2c6f2 in NSApplicationMain () from /System/Library/Libraries/libgnustep-gui.so.0.26
> #20 0x0804ab52 in main ()

The only thing that could go wrong from out side in this X call are the parameters that we provide. What you could try to do is to log the X display variable „dpy“ right before this call. I do not see how this could happen but maybe this is still not initialised with a sensible value.
_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: gui apps segfault on Linux/x86/clang/libobjc2

Riccardo Mottola-5
Hi Fred,


Fred Kiefer wrote:
> The only thing that could go wrong from out side in this X call are the parameters that we provide. What you could try to do is to log the X display variable „dpy“ right before this call. I do not see how this could happen but maybe this is still not initialised with a sensible value.


as what could I print out display? I tried as unsigned integer, in
[XGServerWindow iconSize]:

2018-12-05 08:36:00.264 Ink[8694:8694] styleoffsets ... guessing offsets
2018-12-05 08:36:00.273 Ink[8694:8694] styleoffsets ... guessing offsets
2018-12-05 08:36:00.470 Ink[8694:8694] iconsize - dpy 138629760
2018-12-05 08:36:00.471 Ink[8694:8694] iconsize - dpy 138629760

Program received signal SIGSEGV, Segmentation fault.
0xb3ead101 in xcb_writev () from /usr/lib/libxcb.so.1

is that where you would check? The stacktrace is corrupt and I can't get
the exact place of the call.

Riccardo

_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: gui apps segfault on Linux/x86/clang/libobjc2

Fred Kiefer


> Am 05.12.2018 um 08:50 schrieb Riccardo Mottola <[hidden email]>:
> Fred Kiefer wrote:
>> The only thing that could go wrong from out side in this X call are the parameters that we provide. What you could try to do is to log the X display variable „dpy“ right before this call. I do not see how this could happen but maybe this is still not initialised with a sensible value.
>
>
> as what could I print out display? I tried as unsigned integer, in [XGServerWindow iconSize]:
>
> 2018-12-05 08:36:00.264 Ink[8694:8694] styleoffsets ... guessing offsets
> 2018-12-05 08:36:00.273 Ink[8694:8694] styleoffsets ... guessing offsets
> 2018-12-05 08:36:00.470 Ink[8694:8694] iconsize - dpy 138629760
> 2018-12-05 08:36:00.471 Ink[8694:8694] iconsize - dpy 138629760
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xb3ead101 in xcb_writev () from /usr/lib/libxcb.so.1
>
> is that where you would check? The stacktrace is corrupt and I can't get the exact place of the call.

Yes, this is what I meant. Now you could compare this number to the display allocated for us in libs-back/Source/x11/XGServer.m at about line 422. Just print that out with a similar statement and the two numbers should match.
What is quite strange in your output is that this is reported twice. This looks like the icon size method gets called two times. This would mean that the first time this is handle correctly but fails the second time. could it be that these two calls happen at the same time? Could you also please print out the thread that is making these calls?

Fred


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: gui apps segfault on Linux/x86/clang/libobjc2

Riccardo Mottola-5
Hi,


Fred Kiefer wrote:

>>
>> is that where you would check? The stacktrace is corrupt and I can't get the exact place of the call.
>
> Yes, this is what I meant. Now you could compare this number to the display allocated for us in libs-back/Source/x11/XGServer.m at about line 422. Just print that out with a similar statement and the two numbers should match.
> What is quite strange in your output is that this is reported twice. This looks like the icon size method gets called two times. This would mean that the first time this is handle correctly but fails the second time. could it be that these two calls happen at the same time? Could you also please print out the thread that is making these calls?

The numbers do match:

multix@think ~/gnustep-cvs/libs-back $ Ink
2018-12-07 00:48:18.639 Ink[7166:7166] XGServer init-context dpy: 150880672
2018-12-07 00:48:18.650 Ink[7166:7166] styleoffsets ... guessing offsets
2018-12-07 00:48:18.650 Ink[7166:7166] styleoffsets ... guessing offsets
2018-12-07 00:48:19.073 Ink[7166:7166] iconsize - dpy 150880672
2018-12-07 00:48:19.074 Ink[7166:7166] iconsize - dpy 150880672
Segmentation fault

I don't know how to print out the thread, I too think that two calls
aren't good.

I tried putting a breakpoint and getting the stacktraces for the two
calls and they are:
4565      NSLog(@"iconsize - dpy %lu", (unsigned long)dpy);
(gdb) bt
#0  -[XGServer(WindowOps) iconSize] (self=0x8434f64, _cmd=0xb7f74b30
<.objc_selector_list+88>) at XGServerWindow.m:4565
#1  0xb7d41c5a in GSGetIconFrame () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#2  0xb7a6251f in -[NSApplication(Private) _appIconInit] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#3  0xb7a58041 in -[NSApplication _init] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#4  0xb7455232 in -[NSObject performSelector:withObject:] () from
/System/Library/Libraries/libgnustep-base.so.1.25
#5  0xb74eb675 in -[NSObject(NSThreadPerformAdditions)
performSelector:onThread:withObject:waitUntilDone:modes:] ()
    from /System/Library/Libraries/libgnustep-base.so.1.25
#6  0xb74eb2ec in -[NSObject(NSThreadPerformAdditions)
performSelectorOnMainThread:withObject:waitUntilDone:modes:] ()
    from /System/Library/Libraries/libgnustep-base.so.1.25
#7  0xb74eb391 in -[NSObject(NSThreadPerformAdditions)
performSelectorOnMainThread:withObject:waitUntilDone:] ()
    from /System/Library/Libraries/libgnustep-base.so.1.25
#8  0xb7a58420 in -[NSApplication init] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#9  0xb7a57bbf in +[NSApplication sharedApplication] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#10 0xb7a2c6f2 in NSApplicationMain () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#11 0x0804ab52 in main ()

4565      NSLog(@"iconsize - dpy %lu", (unsigned long)dpy);
(gdb) bt
#0  -[XGServer(WindowOps) iconSize] (self=0x8434f64, _cmd=0xb7f74b30
<.objc_selector_list+88>) at XGServerWindow.m:4565
#1  0xb7d418fe in GSGetIconSize () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#2  0xb7a56380 in +[NSAppIconView initialize] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#3  0xb714015c in objc_send_initialize () from
/System/Library/Libraries/libobjc.so.4.6
#4  0xb714c4d8 in slowMsgLookup () from
/System/Library/Libraries/libobjc.so.4.6
#5  0xb71525e1 in objc_msgSend () from
/System/Library/Libraries/libobjc.so.4.6
#6  0xb7a626cd in -[NSApplication(Private) _appIconInit] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#7  0xb7a58041 in -[NSApplication _init] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#8  0xb7455232 in -[NSObject performSelector:withObject:] () from
/System/Library/Libraries/libgnustep-base.so.1.25
#9  0xb74eb675 in -[NSObject(NSThreadPerformAdditions)
performSelector:onThread:withObject:waitUntilDone:modes:] ()
    from /System/Library/Libraries/libgnustep-base.so.1.25
#10 0xb74eb2ec in -[NSObject(NSThreadPerformAdditions)
performSelectorOnMainThread:withObject:waitUntilDone:modes:] ()
    from /System/Library/Libraries/libgnustep-base.so.1.25
#11 0xb74eb391 in -[NSObject(NSThreadPerformAdditions)
performSelectorOnMainThread:withObject:waitUntilDone:] ()
    from /System/Library/Libraries/libgnustep-base.so.1.25
#12 0xb7a58420 in -[NSApplication init] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#13 0xb7a57bbf in +[NSApplication sharedApplication] () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#14 0xb7a2c6f2 in NSApplicationMain () from
/System/Library/Libraries/libgnustep-gui.so.0.26
#15 0x0804ab52 in main ()
(gdb)

they are two calls for icon frame and size? Maybe this causes issues?
Concurrency?

Riccardo

_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep