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 09:47:36 +0100
User-agent: SOGoMail 4.0.2

Hi,

Am Sonntag, November 25, 2018 21:22 CET, David Chisnall 
<gnustep@theravensnest.org> schrieb:

> On 25 Nov 2018, at 18:30, Sebastian Reitenbach 
> <sebastia@l00-bugdead-prods.de> wrote:
> >
> > So, the thing is, when I replace all /usr/bin/ld* with the /usr/bin/ld.bfd, 
> > and rebuild everything,
> > then GUI apps, as well as SOGo start up. But I can't do that when building 
> > packages :(
>
> You can do that with -fuse-ld=bfd in LDFLAGS, but I agree it’s not the right 
> solution.

This workaround is good for the time being getting things to work again.

>
> The bugs that you’re seeing look as if they may be symptoms of the hash table 
> bugs that I fixed in libobjc2 a month or two ago.  Can you check if they’re 
> still there with the 1.9 release branch?

Installing the 1.9 branch doesn't seem to help, the error persists. First when 
creating the package for the 1.9 branch, I got some
error when the ports infrastructued atempted to install it into the fake-root:

===>  Faking installation for gnustep-libobjc2-1.9.0
[0/1] cd /home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/build-amd64 && 
/usr/local/bin/cmake -P cmake_install.cmake
-- Install configuration: "Release"
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/lib/libobjc2.so.1.1
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/lib/libobjc2.a
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/Availability.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/Object.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/Protocol.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/blocks_private.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/blocks_runtime.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/capabilities.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/developer.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/encoding.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/hooks.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/message.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/objc-api.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/objc-arc.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/objc-auto.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/objc-class.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/objc-runtime.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/objc.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/runtime-deprecated.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/runtime.h
-- Installing: 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/slot.h
failed to create symbolic link 'include/Block.h': No such file or directory
-- Symlinking: include/Block.h -> include/gnustep/objc/blocks_runtime.h
failed to create symbolic link 'include/Block_private.h': No such file or 
directory
-- Symlinking: include/Block_private.h -> include/gnustep/objc/blocks_private.h
sebastia@communicator:/home/ports/x11/gnustep/libobjc2> find 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0 -name Block.h
sebastia@communicator:/home/ports/x11/gnustep/libobjc2> find 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0 -name blocks_runtime.h
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/blocks_runtime.h
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/objc/blocks_runtime.h
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/fake-amd64/usr/local/include/gnustep/objc/blocks_runtime.h

In order to get me going, I created this symlink, and the Block_private.h 
symlink manually, and commented out the two
lines creating the symlinks from the CMakeLists.txt file.
With that manual editing I got the 1.9 branch installed, and rebuilt all the 
rest of GNUstep.

However, the problem is still there, see new stepping through gdb at the end.
Let me know if there is any more info I can provide, or if there is something 
else I should test.

thanks,
Sebastian


sebastia@communicator:/tmp> egdb /usr/local/bin/GMines                          
                                                              
GNU gdb (GDB) 7.12.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-openbsd6.4".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/bin/GMines...done.
(gdb) r
Starting program: /usr/local/bin/GMines

Program received signal SIGFPE, Arithmetic exception.
0x00000527770d024c in _dl_find_symbol_obj (obj=0x52722e05c00, 
sl=0x7f7fffff5108) at /usr/src/libexec/ld.so/resolve.c:584
584             for (si = obj->buckets[sl->sl_elf_hash % obj->nbuckets];
(gdb) bt
#0  0x00000527770d024c in _dl_find_symbol_obj (obj=0x52722e05c00, 
sl=0x7f7fffff5108) at /usr/src/libexec/ld.so/resolve.c:584
#1  0x00000527770d0068 in _dl_find_symbol (name=0x526ae984ea5 "getpid", 
this=0x7f7fffff51a8, flags=48, ref_sym=0x526ae9194c8, req_obj=<optimized out>, 
pobj=0x7f7fffff51a0)
    at /usr/src/libexec/ld.so/resolve.c:663
#2  0x00000527770cef1a in _dl_bind (object=0x526d8585800, index=<optimized 
out>) at /usr/src/libexec/ld.so/amd64/rtld_machine.c:357
#3  0x00000527770d0fed in _dl_bind_start () at 
/usr/src/libexec/ld.so/amd64/ldasm.S:108
#4  0x00000526aedbe4d4 in NSLogv (format=0x526be50df08, args=0x7f7fffff54f0) at 
NSLog.m:350
#5  0x00000526aecc6d05 in -[NSAssertionHandler 
handleFailureInFunction:file:lineNumber:description:] (self=0x526cc013ef8, 
_cmd=0x52731dc3a18 <.objc_selector_list+1984>,
    functionName=0x52737e9bc88, fileName=0x5271bbe0988, line=323, 
format=0x52731dc10e8 <.objc_str.404>) at NSAssertionHandler.m:101
#6  0x0000052731a32c57 in initialize_gnustep_backend () at NSApplication.m:322
#7  0x0000052731a3522b in -[NSApplication _init] (self=0x5270bc8e308, 
_cmd=0x52731dc3558 <.objc_selector_list+768>) at NSApplication.m:878
#8  0x00000526aede1522 in -[NSObject performSelector:withObject:] 
(self=0x5270bc8e308, _cmd=0x526af008360 <.objc_selector_list>,
    aSelector=0x52731dc3558 <.objc_selector_list+768>, anObject=0x5270bc8e308) 
at NSObject.m:2000
#9  0x00000526aee7773a in -[NSObject(NSThreadPerformAdditions) 
performSelector:onThread:withObject:waitUntilDone:modes:] (self=0x5270bc8e308,
    _cmd=0x526af0085c0 <.objc_selector_list+608>, aSelector=0x52731dc3558 
<.objc_selector_list+768>, aThread=0x5269ef8eb08, anObject=0x5270bc8e308, 
aFlag=1 '\001',
    anArray=0x52754df30c8) at NSThread.m:1672
#10 0x00000526aee773f3 in -[NSObject(NSThreadPerformAdditions) 
performSelectorOnMainThread:withObject:waitUntilDone:modes:] 
(self=0x5270bc8e308,
    _cmd=0x526af008600 <.objc_selector_list+672>, aSelector=0x52731dc3558 
<.objc_selector_list+768>, anObject=0x5270bc8e308, aFlag=1 '\001', 
anArray=0x52754df30c8)
    at NSThread.m:1627
#11 0x00000526aee7748e in -[NSObject(NSThreadPerformAdditions) 
performSelectorOnMainThread:withObject:waitUntilDone:] (self=0x5270bc8e308,
    _cmd=0x52731dc3358 <.objc_selector_list+256>, aSelector=0x52731dc3558 
<.objc_selector_list+768>, anObject=0x5270bc8e308, aFlag=1 '\001') at 
NSThread.m:1638
#12 0x0000052731a35995 in -[NSApplication init] (self=0x5270bc8e308, 
_cmd=0x52731dc3b78 <.objc_selector_list+2336>) at NSApplication.m:978
#13 0x0000052731a3519d in +[NSApplication sharedApplication] 
(self=0x52731dc28b8 <_OBJC_CLASS_NSApplication>, _cmd=0x524923ff1d8 
<.objc_selector_list+16>) at NSApplication.m:850
#14 0x00000524923f1fc2 in gnustep_base_user_main (argc=1, argv=0x7f7fffff5b78, 
env=0x7f7fffff5b88) at main.m:44
#15 0x00000526aee152f7 in main (argc=1, argv=0x7f7fffff5b78, 
env=0x7f7fffff5b88) at NSProcessInfo.m:1002
#16 0x00000524923ee056 in ___start ()
#17 0x0000000000000000 in ?? ()
(gdb) fram 6
#6  0x0000052731a32c57 in initialize_gnustep_backend () at NSApplication.m:322
322             NSCAssert1 (backend != Nil,
(gdb) list
317                         path);
318
319             /* Now get the GSBackend class, which should have just been 
loaded
320              * from the bundle.  */
321             backend = NSClassFromString (@"GSBackend");
322             NSCAssert1 (backend != Nil,
323               _(@"Backend at path %@ doesn't contain the GSBackend class"), 
path);
324             [backend initializeBackend];
325           }
326
(gdb) break NSApplication.m:321
Breakpoint 1 at 0x52731a32b2e: file NSApplication.m, line 321.
(gdb) c
Continuing.

Program terminated with signal SIGFPE, Arithmetic exception.
The program no longer exists.
(gdb) r
Starting program: /usr/local/bin/GMines

Breakpoint 1, initialize_gnustep_backend () at NSApplication.m:321
321             backend = NSClassFromString (@"GSBackend");
(gdb) s
NSClassFromString (aClassName=0xe3b0ee55008) at NSObjCRuntime.m:107
107     {
(gdb)
108       if (aClassName != nil)
(gdb)
110           int       len = [aClassName length];
(gdb)
111           char      buf[len+1];
(gdb)
113           [aClassName getCString: buf
(gdb)
114                        maxLength: len + 1
(gdb)
113           [aClassName getCString: buf
(gdb)
116           return objc_lookUpClass (buf);
(gdb)
objc_lookUpClass (name=0xde02e335da7ed992 <error: Cannot access memory at 
address 0xde02e335da7ed992>)
    at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/class_table.c:530
530     {
(gdb) s
531             return (id)class_table_get_safe(name);
(gdb)
class_table_get_safe (class_name=0xe3aadc5663f <objc_lookUpClass+31> 
"H\203\304\bA[]L3\034$L;\035\237\354\001")
    at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/class_table.c:130
130     {
(gdb) list
125             }
126             class_table_internal_insert(class_table, class);
127     }
128
129     PRIVATE Class class_table_get_safe(const char *class_name)
130     {
131             if (NULL == class_name) { return Nil; }
132             return class_table_internal_table_get(class_table, class_name);
133     }
134
(gdb) s
131             if (NULL == class_name) { return Nil; }
(gdb)
132             return class_table_internal_table_get(class_table, class_name);
(gdb)
class_table_internal_table_get (table=0x7f7ffffe4ff0, key=0xa) at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/hash_table.h:434
434     {
(gdb)
435             PREFIX(_table_cell) cell = PREFIX(_table_get_cell)(table, key);
(gdb)
class_table_internal_table_get_cell (table=0xe3b21ef2b80, key=0x7f7ffffe4ff0) 
at /home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/hash_table.h:337
337     {
(gdb)
338             uint32_t hash = MAP_TABLE_HASH_KEY(key);
(gdb)
string_hash (str=0x7f7ffffe4fe0 "`P\376\377\177\177") at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/string_hash.h:9
9       {
(gdb)
10              uint32_t hash = 0;
(gdb)
12              while ((c = *str++))
(gdb)
14                      hash = c + (hash << 6) + (hash << 16) - hash;
(gdb)
12              while ((c = *str++))
(gdb)
14                      hash = c + (hash << 6) + (hash << 16) - hash;
(gdb)
12              while ((c = *str++))
(gdb)
14                      hash = c + (hash << 6) + (hash << 16) - hash;
(gdb)
12              while ((c = *str++))
(gdb)
14                      hash = c + (hash << 6) + (hash << 16) - hash;
(gdb)
12              while ((c = *str++))
(gdb)
14                      hash = c + (hash << 6) + (hash << 16) - hash;
(gdb)
12              while ((c = *str++))
(gdb)
14                      hash = c + (hash << 6) + (hash << 16) - hash;
(gdb)
12              while ((c = *str++))
(gdb)
14                      hash = c + (hash << 6) + (hash << 16) - hash;
(gdb)
12              while ((c = *str++))
(gdb)
14                      hash = c + (hash << 6) + (hash << 16) - hash;
(gdb)
12              while ((c = *str++))
(gdb)
14                      hash = c + (hash << 6) + (hash << 16) - hash;
(gdb)
12              while ((c = *str++))
(gdb)
16              return hash;
(gdb)
class_table_internal_table_get_cell (table=0xe3b21ef2b80, key=0x7f7ffffe4ff0) 
at /home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/hash_table.h:339
339             PREFIX(_table_cell) cell = PREFIX(_table_lookup)(table, hash);
(gdb) print hash
$1 = 4054769640
(gdb) print table
$2 = (class_table_internal_table *) 0xe3b21ef2b80
(gdb)
$3 = (class_table_internal_table *) 0xe3b21ef2b80
(gdb) s
class_table_internal_table_lookup (table=0x7f7ffffe4fe0, hash=3643) at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/hash_table.h:218
218     {
(gdb)
219             hash = hash % TABLE_SIZE(table);
(gdb)
220             return &table->table[hash];
(gdb) print &table->table[hash]
$4 = (struct class_table_internal_table_cell_struct *) 0xe3b5cce3e80
(gdb) print table->table[hash]
$5 = {secondMaps = 0, value = 0xe3b5265a620 <_OBJC_CLASS_IBConnectionRecord>}
(gdb) s
class_table_internal_table_get_cell (table=0xe3b21ef2b80, key=0x7f7ffffe4ff0) 
at /home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/hash_table.h:341
341             if (!MAP_TABLE_VALUE_NULL(cell->value))
(gdb) print cell->value
$6 = (void *) 0xe3b5265a620 <_OBJC_CLASS_IBConnectionRecord>
(gdb) s
class_table_internal_is_null (value=0x7f7ffffe4fe0) at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/hash_table.h:76
76      {
(gdb)
77              return value == NULL;
(gdb)
class_table_internal_table_get_cell (table=0xe3b21ef2b80, key=0x7f7ffffe4ff0) 
at /home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/hash_table.h:343
343                     if (MAP_TABLE_COMPARE_FUNCTION(key, cell->value))
(gdb) print key
$7 = (const void *) 0x7f7ffffe4ff0
(gdb) print (char *) key
$8 = 0x7f7ffffe4ff0 "GSBackend"
(gdb) print cell->value
$9 = (void *) 0xe3b5265a620 <_OBJC_CLASS_IBConnectionRecord>
(gdb) s
class_compare (name=0x7f7ffffe4fe0 "`P\376\377\177\177", class=0xe3b21ef2b80) 
at /home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/class_table.c:70
70      {
(gdb)
71              return string_compare(name, class->name);
(gdb) print name
$10 = 0x7f7ffffe4ff0 "GSBackend"
(gdb) print class->name
$11 = 0xe3b519e5d0e "IBConnectionRecord"
(gdb) s
string_compare (str1=0xe3b5265a620 <_OBJC_CLASS_IBConnectionRecord> 
"\220\245eR;\016", str2=0xe3b75f04e10 <str_encoding_table> "\001")
    at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/string_hash.h:24
24      {
(gdb)
25              if (str1 == str2)
(gdb)
29              if (str1 == NULL || str2 == NULL)
(gdb)
33              return strcmp(str1, str2) == 0;
(gdb)
strcmp () at /usr/src/lib/libc/arch/amd64/string/strcmp.S:12
12              RETGUARD_SETUP(strcmp, r11)
(gdb) print str1
No symbol "str1" in current context.
(gdb)
No symbol "str1" in current context.
(gdb)
No symbol "str1" in current context.
(gdb) s
18              testb   $7,%dil
(gdb)
19              je      .Ls1aligned
(gdb)
35              testb   $7,%sil
(gdb)
36              jne     .Lbyte_loop
(gdb)
59              movb    (%rdi),%al
(gdb)
60              incq    %rdi
(gdb)
61              movb    (%rsi),%dl
(gdb)
62              incq    %rsi
(gdb)
63              testb   %al,%al
(gdb)
64              je      .Ldone
(gdb)
65              cmpb    %al,%dl
(gdb)
66              je      .Lbyte_loop
(gdb)
69              movzbq  %al,%rax
(gdb)
70              movzbq  %dl,%rdx
(gdb)
71              subq    %rdx,%rax
(gdb)
72              RETGUARD_CHECK(strcmp, r11)
(gdb)
strcmp () at /usr/src/lib/libc/arch/amd64/string/strcmp.S:73
73              ret
(gdb)
string_compare (str1=0x7f7ffffe4ff0 "GSBackend", str2=0xe3b519e5d0e 
"IBConnectionRecord") at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/string_hash.h:34
34      }
(gdb)
class_table_internal_table_get_cell (table=0xe3b21ef2b80, key=0x7f7ffffe4ff0) 
at /home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/hash_table.h:347
347                     uint32_t jump = cell->secondMaps;
(gdb)
349                     for (int hop = __builtin_ffs(jump) ; hop > 0 ; hop = 
__builtin_ffs(jump))
(gdb)
359             }
(gdb) print hop
No symbol "hop" in current context.
(gdb)
No symbol "hop" in current context.
(gdb)
No symbol "hop" in current context.
(gdb) s
361             if (table->old)
(gdb)
366             return NULL;
(gdb)
367     }
(gdb)
class_table_internal_table_get (table=0xe3b21ef2b80, key=0x7f7ffffe4ff0) at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/hash_table.h:436
436             if (NULL == cell)
(gdb) print cell
$12 = (class_table_internal_table_cell) 0x0
(gdb)
$13 = (class_table_internal_table_cell) 0x0
(gdb) s
441                     return MAP_TABLE_VALUE_PLACEHOLDER;
(gdb)
449     }
(gdb)
class_table_get_safe (class_name=0x7f7ffffe4ff0 "GSBackend") at 
/home/ports/pobj/amd64/gnustep-libobjc2-1.9.0/libobjc2-1.9.0/class_table.c:133
133     }
(gdb)
NSClassFromString (aClassName=0xe3b5247afe0 <.objc_str.393>) at 
NSObjCRuntime.m:117
117         }
(gdb)
119     }
(gdb)
initialize_gnustep_backend () at NSApplication.m:322
322             NSCAssert1 (backend != Nil,
(gdb)




reply via email to

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