[Bug corefiles/25269] New: Running a program with "exec -a bar /lib64/ld-linux-x86-64.so.2 ./test" produces a core that confuses gdb

rafael at espindo dot la sourceware-bugzilla@sourceware.org
Tue Dec 10 17:28:00 GMT 2019


https://sourceware.org/bugzilla/show_bug.cgi?id=25269

            Bug ID: 25269
           Summary: Running a program with "exec -a bar
                    /lib64/ld-linux-x86-64.so.2 ./test" produces a core
                    that confuses gdb
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: corefiles
          Assignee: unassigned at sourceware dot org
          Reporter: rafael at espindo dot la
  Target Milestone: ---

If the trivial test program:

#include <stdio.h>
#include <stdlib.h>
__thread int foo = 42;
int main(int argc, char* argv[]) {
    printf("%s %d\n", argv[0], foo);
    abort(); // produce a core
    return 0;
}

Is run with

$ exec -a bar /lib64/ld-linux-x86-64.so.2 ./test

The resulting core file confuses gdb somehow:

$ gdb -q ./test ./core.ld-linux-x86-64.146498
Reading symbols from ./test...
[New LWP 146498]

warning: Could not load shared library symbols for bar.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `bar ./test'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f0adc7d5625 in raise () from /lib64/libc.so.6
(gdb) p foo
Cannot find thread-local storage for Thread 0x7f0adc796740 (LWP 146498),
executable file /home/espindola/scylla/test:
generic error

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list