discuss-gnustep
[Top][All Lists]
Advanced

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

Re: loading bundles stopped working


From: Sebastian Reitenbach
Subject: Re: loading bundles stopped working
Date: Wed, 28 Nov 2018 12:35:08 +0100
User-agent: SOGoMail 4.0.2

Am Dienstag, November 27, 2018 11:02 CET, David Chisnall 
<gnustep@theravensnest.org> schrieb:

> On 26/11/2018 20:40, Sebastian Reitenbach wrote:
> >   I think I finally found where the dlopen() is called, in gnustep base
> > dynamic-load.h (which is generated while building it, took me a while
> > to find that ;)
> >
> >  From what I can see, things look good as it successfully dlopens
> > the gnustep-back backend file, but then it never calls __objc_exec_class??
>
> I can't tell for sure from your debugging log, but it looks as if you
> don't have a breakpoint set on __objc_exec_class when you step over the
> dlopen call.  You won't be able to step into dlopen (unless you want to
> recompile rtld with debug info, but I wouldn't recommend that), so you
> need to make sure that you set the breakpoint before you let the process
> call dlopen.  You can then step into the __objc_exec_class calls and see
> if it's actually loading things correctly.

Sorry, my update to fix gnustep on openbsd broke some other shit's that I had
to fix first ;)
Now back here:

(gdb) bt
#0  initialize_gnustep_backend () at NSApplication.m:309
#1  0x0000093f1dcb033b in -[NSApplication _init] (self=0x93ecbd3a008, 
_cmd=0x93f1e03eef8 <.objc_selector_list+3232>) at NSApplication.m:878
#2  0x0000093ec2a28428 in -[NSObject performSelector:withObject:] 
(self=0x93ecbd3a008, _cmd=0x93ec2c4f460 <.objc_selector_list+256>,
    aSelector=0x93f1e03eef8 <.objc_selector_list+3232>, anObject=0x93ecbd3a008) 
at NSObject.m:2000
#3  0x0000093ec2abe4f3 in -[NSObject(NSThreadPerformAdditions) 
performSelector:onThread:withObject:waitUntilDone:modes:] (self=0x93ecbd3a008,
    _cmd=0x93ec2c4f5e0 <.objc_selector_list+640>, aSelector=0x93f1e03eef8 
<.objc_selector_list+3232>, aThread=0x93ecbd3ae08, anObject=0x93ecbd3a008, 
aFlag=1 '\001',
    anArray=0x93f1b8f3dc8) at NSThread.m:1672
#4  0x0000093ec2abe1a0 in -[NSObject(NSThreadPerformAdditions) 
performSelectorOnMainThread:withObject:waitUntilDone:modes:] 
(self=0x93ecbd3a008,
    _cmd=0x93ec2c4f600 <.objc_selector_list+672>, aSelector=0x93f1e03eef8 
<.objc_selector_list+3232>, anObject=0x93ecbd3a008, aFlag=1 '\001', 
anArray=0x93f1b8f3dc8)
    at NSThread.m:1627
#5  0x0000093ec2abe23e in -[NSObject(NSThreadPerformAdditions) 
performSelectorOnMainThread:withObject:waitUntilDone:] (self=0x93ecbd3a008,
    _cmd=0x93f1e03f088 <.objc_selector_list+3632>, aSelector=0x93f1e03eef8 
<.objc_selector_list+3232>, anObject=0x93ecbd3a008, aFlag=1 '\001') at 
NSThread.m:1638
#6  0x0000093f1dcb0aa5 in -[NSApplication init] (self=0x93ecbd3a008, 
_cmd=0x93f1e03f748 <.objc_selector_list+5360>) at NSApplication.m:978
#7  0x0000093f1dcb02ad in +[NSApplication sharedApplication] 
(self=0x93f1e03d8b8 <_OBJC_CLASS_NSApplication>, _cmd=0x93c629652b8 
<.objc_selector_list+240>)
    at NSApplication.m:850
#8  0x0000093c62957f95 in gnustep_base_user_main (argc=1, argv=0x7f7ffffd3e68, 
env=0x7f7ffffd3e78) at main.m:44
#9  0x0000093ec2a5c017 in main (argc=1, argv=0x7f7ffffd3e68, 
env=0x7f7ffffd3e78) at NSProcessInfo.m:1002
#10 0x0000093c62954056 in ___start ()
#11 0x0000000000000000 in ?? ()
(gdb) info break
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x0000093f1dcad9a2 in 
initialize_gnustep_backend at NSApplication.m:309
        breakpoint already hit 1 time
2       breakpoint     keep y   0x0000093ec291a170 in -[NSBundle load] at 
NSBundle.m:1989
3       breakpoint     keep y   0x0000093ec2b2a750 in __objc_dynamic_link at 
././dynamic-load.h:63
4       breakpoint     keep y   0x0000093ec2b2a750 in __objc_dynamic_link at 
././dynamic-load.h:63
5       breakpoint     keep y   0x0000093e64843ae0 in __objc_exec_class at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/loader.c:46
(gdb) delete 4
(gdb) info break
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x0000093f1dcad9a2 in 
initialize_gnustep_backend at NSApplication.m:309
        breakpoint already hit 1 time
2       breakpoint     keep y   0x0000093ec291a170 in -[NSBundle load] at 
NSBundle.m:1989
3       breakpoint     keep y   0x0000093ec2b2a750 in __objc_dynamic_link at 
././dynamic-load.h:63
5       breakpoint     keep y   0x0000093e64843ae0 in __objc_exec_class at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/loader.c:46
(gdb) c
Continuing.

Breakpoint 2, -[NSBundle load] (self=0x93e9baac588, _cmd=0x93e69deea88) at 
NSBundle.m:1989
1989    - (BOOL) load
(gdb)
Continuing.

Breakpoint 3, __objc_dynamic_link (module=0x93f0c45f248 "8\212\273\302>\t", 
mode=2366, debug_file=0x93f3d9fa8e0 <__sF+304> "") at ././dynamic-load.h:64
warning: Source file is more recent than executable.
64      {
(gdb)
Continuing.

Program received signal SIGFPE, Arithmetic exception.
0x0000093e70b4124c in _dl_find_symbol_obj (obj=0x93ecb3bbc00, 
sl=0x7f7ffffd33f8) at /usr/src/libexec/ld.so/resolve.c:584
584             for (si = obj->buckets[sl->sl_elf_hash % obj->nbuckets];

So I stopped at NSApplication.m:309, and then added the breakpoints in 
dynamic-load.h and in libobjc loader.c where the __objc_exec_class resides, and 
then continued to execute, but it doesn't hit the breakpoint 5 before throwing 
the FPE.

But when I set breakpoint on __objc_exec_class and restart the program from the 
beginning, I see it gets hit quite often, when I hit it, backtrace looks like:
Breakpoint 5, __objc_exec_class (module=0x81) at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/loader.c:47
47      {
(gdb) bt
#0  __objc_exec_class (module=0x81) at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/loader.c:47
#1  0x00000cc580676f8f in .objc_load_function () from 
/usr/local/lib/libobjc2.so.1.1
#2  0x00000cc5806570d3 in _do_init () from /usr/local/lib/libobjc2.so.1.1
#3  0x00000cc5806779e9 in _init () from /usr/local/lib/libobjc2.so.1.1
#4  0x00007f7ffffea060 in ?? ()
#5  0x00000cc5eccab0c3 in _dl_call_init_recurse (object=0xcc579983400, 
initfirst=0) at /usr/src/libexec/ld.so/loader.c:770
#6  0x00000cc5eccab056 in _dl_call_init_recurse (object=0xcc5b2205c00, 
initfirst=0) at /usr/src/libexec/ld.so/loader.c:756
#7  0x00000cc5eccab056 in _dl_call_init_recurse (object=0xcc5b5534400, 
initfirst=0) at /usr/src/libexec/ld.so/loader.c:756
#8  0x00000cc5eccab056 in _dl_call_init_recurse (object=0xcc5b5534c00, 
initfirst=0) at /usr/src/libexec/ld.so/loader.c:756
#9  0x00000cc5eccaaaf1 in _dl_call_init (object=0xcc5b5534c00) at 
/usr/src/libexec/ld.so/loader.c:743
#10 _dl_boot (argv=0x7f7ffffea228, envp=<optimized out>, 
dyn_loff=14044220776448, dl_data=0x7f7ffffea190) at 
/usr/src/libexec/ld.so/loader.c:638
#11 0x00000cc5eccb5fb6 in _dl_start () at 
/usr/src/libexec/ld.so/amd64/ldasm.S:61
#12 0x0000000000000000 in ?? ()

Sebastian




reply via email to

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