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: Mon, 26 Nov 2018 21:40:16 +0100
User-agent: SOGoMail 4.0.2

Am Montag, November 26, 2018 16:14 CET, David Chisnall 
<gnustep@theravensnest.org> schrieb:

> On 26/11/2018 15:03, Sebastian Reitenbach wrote:
> >  From the stacktrace, It's the last NSCAssert1 that fires, right after that 
> > line:
> > backend = NSClassFromString (@"GSBackend");
>
> Yup.  That makes me think either:
>
> - The dlopen failed.
> - The dlopen returned success, but didn't call the constructor, so it
> didn't call __objc_exec_class.
> - The library was loaded but some memory was corrupted.
>
> > So before that, there's the other NSCAssert1, [theBundle load], and since
> > this doesn't fire, I think loading it, went OK?
> > But I might well be on the wrong track.
>
> Can you disable the breakpoint on __objc_exec_class until just before
> the [theBundle load] line, then enable it and make sure that it's called
> *after* the dlopen call?  Can you also check in the code that we're
> actually checking the return from dlopen correctly (I'm pretty sure we are).
>
> If all this works, can you check in each __objc_exec_class call and see
> if one of the classes that it loads is called GSBackend?  If so, then it
> looks as if there's still something wrong with the hash table in
> libobjc2.  I think I back-ported all of the fixes to the 1.9 branch, but
> I might have missed one...
>
> David

 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??

Sebastian

Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (NSApplication.m:309) pending.
(gdb) break NSBundle.m:1989
No source file named NSBundle.m.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 2 (NSBundle.m:1989) pending.
(gdb) break dynamic-load.h:63
No source file named dynamic-load.h.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 3 (dynamic-load.h:63) pending.
(gdb) r
Starting program: /usr/local/bin/GMines

Breakpoint 1, initialize_gnustep_backend () at NSApplication.m:309
309             theBundle = [NSBundle bundleWithPath: path];
(gdb) c
Continuing.

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

Breakpoint 3, __objc_dynamic_link (module=0xda7dfb59148 "8*\033k\250\r", 
mode=3496,
    debug_file=0xda83944f8e0 <__sF+304> "") at ././dynamic-load.h:64
warning: Source file is more recent than executable.
64      {
(gdb) list
59      /* Link in the module given by the name 'module'.  Return a handle 
which can
60         be used to get information about the loded code.
61      */
62      static dl_handle_t
63      __objc_dynamic_link(const char* module, int mode, const char* 
debug_file)
64      {
65      #ifdef RTLD_NOLOAD
66              /*
67               * If we've got RTLD_NOLOAD, then ask the dynamic linker first 
to check if
68               * the library is already loaded.  If it is, then just return a 
handle to
(gdb) n
77          return (dl_handle_t)dlopen(module, RTLD_LAZY | RTLD_GLOBAL);
(gdb) print module
$1 = 0xda79dff5390 
"/usr/local/lib/GNUstep/Bundles/libgnustep-back-026.bundle/libgnustep-back-026"
(gdb) s
GSPrivateLoadModule (filename=0xda82c10fd08, errorStream=0xda83944f8e0 
<__sF+304>,
    loadCallback=0xda86af147c0 <_bundle_load_callback>, header=0x0, 
debugFilename=0x0) at objc-load.m:173
173       if (handle == 0)
(gdb) list
168
169       /* Link in the object file */
170       NSDebugFLLog(@"NSBundle", @"Debug (objc-load): Linking file %@\n", 
filename);
171       handle = __objc_dynamic_link((FSCHAR*)[filename 
fileSystemRepresentation],
172         1, (FSCHAR*)[debugFilename fileSystemRepresentation]);
173       if (handle == 0)
174         {
175           if (errorStream)
176             {
177               __objc_dynamic_error(errorStream, "Error (objc-load)");
(gdb) print handle
$2 = (dl_handle_t) 0xda7eddb7000
(gdb)(gdb) break loader.c:46
Breakpoint 4 at 0xda836645ae0: file 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/loader.c, line 46.
(gdb) c
Continuing.

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




reply via email to

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