assertion when using clang + libobjc2

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

assertion when using clang + libobjc2

Riccardo Mottola-5
Hi All,

I just finished upgrading a Linux/x86 system where I run clang as
compiler and David's libobjc2 compiled from our sources. It is gentoo
stable, whith clang 5.0

libobjc2 was compiled with the same clang and from git head.

After updating libobjc2, any program dies:

  $ plparse
plparse: /home/multix/gnustep-cvs/libobjc2/protocol.c:226: BOOL
init_protocols(struct objc_protocol_list *): Assertion `aProto->isa ==
protocol_class_gcc' failed.
Aborted

I have recompiled also base, just for safety, but no help.


any clues?
Riccardo

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

Re: assertion when using clang + libobjc2

David Chisnall-7
Hi Riccardo,

Thank you for the report.  Most of the tests don’t build with the GCC ABI, so that code path is not as well tested as the two newer ABIs - thank you for testing it, and please do file bugs if you hit any more issues.  I believe this is now fixed in git.

David

> On 30 May 2018, at 18:47, Riccardo Mottola <[hidden email]> wrote:
>
> Hi All,
>
> I just finished upgrading a Linux/x86 system where I run clang as compiler and David's libobjc2 compiled from our sources. It is gentoo stable, whith clang 5.0
>
> libobjc2 was compiled with the same clang and from git head.
>
> After updating libobjc2, any program dies:
>
>  $ plparse
> plparse: /home/multix/gnustep-cvs/libobjc2/protocol.c:226: BOOL init_protocols(struct objc_protocol_list *): Assertion `aProto->isa == protocol_class_gcc' failed.
> Aborted
>
> I have recompiled also base, just for safety, but no help.
>
>
> any clues?
> Riccardo


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

Re: assertion when using clang + libobjc2

Riccardo Mottola-5
Hi,

David Chisnall wrote:
> Thank you for the report.  Most of the tests don’t build with the GCC ABI, so that code path is not as well tested as the two newer ABIs - thank you for testing it, and please do file bugs if you hit any more issues.  I believe this is now fixed in git.

indeed, we are a little further. gnustep-base tools do run now!
However, if I launch and GUI application, it will crash, with this
stacktrace:

Program received signal SIGSEGV, Segmentation fault.
__strcmp_ia32 () at ../sysdeps/i386/i686/multiarch/../strcmp.S:33
33      ../sysdeps/i386/i686/multiarch/../strcmp.S: No such file or
directory.
(gdb) bt
#0  __strcmp_ia32 () at ../sysdeps/i386/i686/multiarch/../strcmp.S:33
#1  0xb72038c0 in string_compare ()
    from /System/Library/Libraries/libobjc.so.4.6
#2  0xb72037bc in sel_isEqual () from
/System/Library/Libraries/libobjc.so.4.6
#3  0xb71fe08d in get_method_description ()
    from /System/Library/Libraries/libobjc.so.4.6
#4  0xb71fdf8f in protocol_getMethodDescription ()
    from /System/Library/Libraries/libobjc.so.4.6
#5  0xb7517f60 in GSProtocolGetMethodDescriptionRecursive (
     aProtocol=<optimized out>, aSel=<optimized out>, isRequired=76 'L',
     isInstance=248 '\370') at GSObjCRuntime.m:827
#6  0xb73fd484 in -[NSDistantObject methodSignatureForSelector:] (
     self=0x868b14c, _cmd=<optimized out>,
     aSelector=0xb77c1ff8 <.objc_selector_list+320>) at
NSDistantObject.m:727
#7  0xb75159e7 in GSFFIInvocationCallback (cif=<optimized out>,
     retp=<optimized out>, args=<optimized out>, user=<optimized out>)
     at GSFFIInvocation.m:538
#8  0xb4bb9a75 in ?? () from /usr/lib/libffi.so.6
#9  0xb4bb9e26 in ?? () from /usr/lib/libffi.so.6
#10 0xb7400ab0 in -[NSDistributedNotificationCenter(Private) _connect] (
     self=<optimized out>, _cmd=<optimized out>)
     at NSDistributedNotificationCenter.m:781
#11 0xb73ff743 in -[NSDistributedNotificationCenter
addObserver:selector:name:ob

I thus did run base's tests... here the results:

    6924 Passed tests
      30 Dashed hopes
       9 Failed files
       8 Skipped sets
       5 Failed tests


that's not that good on a standard linux x86 system, but not a disaster
either.

Failed test:         general.m:37 ... -classNamed returns the correct class
Failed test:         general.m:49 ... -executablePath returns an
executable path (gnustep bundle)
Failed test:       general.m:61 ... -principalClass returns TestClass
for +bundleForClass:[TestClass class]
Failed file:     test00.m aborted without running all tests!
Failed file:     test02.m aborted without running all tests!
Failed file:     basic.m aborted without running all tests!
Failed file:     test01.m aborted without running all tests!
Failed file:     test02.m aborted without running all tests!
Failed file:     test03.m aborted without running all tests!
Failed file:     test04.m aborted without running all tests!
Failed file:     test05.m aborted without running all tests!
Failed file:     test06.m aborted without running all tests!
Failed test:     test01.m:44 ... Got the correct data from a 200 -
status load
Failed test:     test01.m:58 ... 404 - status: Handle load not loaded
(resource not found)


only the general.m are probably worrysome, I suppose, they refer to
bundles though and no crash

Riccardo


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

Re: assertion when using clang + libobjc2

Riccardo Mottola-5
In reply to this post by David Chisnall-7
Hi David,

David Chisnall wrote:
> Thank you for the report.  Most of the tests don’t build with the GCC ABI, so that code path is not as well tested as the two newer ABIs - thank you for testing it, and please do file bugs if you hit any more issues.  I believe this is now fixed in git.

I did further thests here and a clean build and recompile of everything.
I did compile a debug version of gnustep-base (although maybe a one for
libobjc is needed to, how is it done with cmake?)

As I wrote, simple tools like plparse do now work, but any gui
application will file.

Here a clean version of Ink:

2018-06-07 00:11:27.699 Ink[6673:6673] styleoffsets ... guessing offsets
2018-06-07 00:11:27.701 Ink[6673:6673] styleoffsets ... guessing offsets

Program received signal SIGSEGV, Segmentation fault.
__strcmp_ia32 () at ../sysdeps/i386/i686/multiarch/../strcmp.S:33
33      ../sysdeps/i386/i686/multiarch/../strcmp.S: No such file or
directory.

#0  __strcmp_ia32 () at ../sysdeps/i386/i686/multiarch/../strcmp.S:33
#1  0xb71058c0 in string_compare ()
    from /System/Library/Libraries/libobjc.so.4.6
#2  0xb71057bc in sel_isEqual () from
/System/Library/Libraries/libobjc.so.4.6
#3  0xb710008d in get_method_description ()
    from /System/Library/Libraries/libobjc.so.4.6
#4  0xb70fff8f in protocol_getMethodDescription ()
    from /System/Library/Libraries/libobjc.so.4.6
#5  0xb75b3443 in GSProtocolGetMethodDescriptionRecursive (
     aProtocol=0xb77bfa50 <.objc_protocol.103>,
     aSel=0xb77c0080 <.objc_selector_list+192>, isRequired=1 '\001',
     isInstance=1 '\001') at GSObjCRuntime.m:827
#6  0xb738bf5c in -[NSDistantObject methodSignatureForSelector:] (
     self=0x86bf9cc, _cmd=0xb78030f4 <.objc_selector_list+200>,
     aSelector=0xb77c0080 <.objc_selector_list+192>) at
NSDistantObject.m:727
#7  0xb75af5d4 in GSFFIInvocationCallback (cif=0x86c5f40, retp=0xbfffe8a0,
     args=0xbfffe830, user=0x86bdc44) at GSFFIInvocation.m:538
#8  0xb4abba75 in ?? () from /usr/lib/libffi.so.6
#9  0xb4abbe26 in ?? () from /usr/lib/libffi.so.6
#10 0xb7392bdb in -[NSDistributedNotificationCenter(Private) _connect] (
     self=0x868cbe4, _cmd=0xb77c0048 <.objc_selector_list+136>)
     at NSDistributedNotificationCenter.m:781
#11 0xb73904e9 in -[NSDistributedNotificationCenter
addObserver:selector:name:object:suspensionBehavior:] (self=0x868cbe4,
     _cmd=0xb77c0038 <.objc_selector_list+120>, anObserver=0x868c8f4,
     aSelector=0xb7f5b798 <.objc_selector_list+352>, notificationName=0x0,
     anObject=0xb7f5b350 <.objc_str.437>, suspensionBehavior=2)
     at NSDistributedNotificationCenter.m:341
#12 0xb7390069 in -[NSDistributedNotificationCenter
addObserver:selector:name:object:] (self=0x868cbe4, _cmd=0xb7f5b850
<.objc_selector_list+536>,
     anObserver=0x868c8f4, aSelector=0xb7f5b798 <.objc_selector_list+352>,
     notificationName=0x0, anObject=0xb7f5b350 <.objc_str.437>)
     at NSDistributedNotificationCenter.m:266
#13 0xb7c49253 in -[_GSWorkspaceCenter init] (self=0x868c8f4,
     _cmd=<optimized out>) at NSWorkspace.m:335

I get no information inside libobjc, however:

(gdb) list
822     struct objc_method_description
823     GSProtocolGetMethodDescriptionRecursive(Protocol *aProtocol, SEL
aSel, BOOL isRequired, BOOL isInstance)
824     {
825       struct objc_method_description desc;
826
827       desc = protocol_getMethodDescription(aProtocol, aSel,
isRequired, isInstance);
828       if (desc.name == NULL && desc.types == NULL)
829         {
830           Protocol **list;
831           unsigned int count;


(gdb) po NSStringFromSelector(aSel)
registerClient:

at first, it does not seem wrong, something is doing hfavoc inside
method description or sel_isEqual


maybe with debug information for libobjc2 I can give you better information

Riccardo

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