This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/22995] New: crash when backtrace includes a removed shared object


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

            Bug ID: 22995
           Summary: crash when backtrace includes a removed shared object
           Product: gdb
           Version: 8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: etesta at undo dot io
  Target Milestone: ---

Created attachment 10910
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10910&action=edit
Reproducer for the issue.

I am using gdb-8.1 and I have a test (attached) that makes GDB crash under the
following scenario:

1) compile the test:

$ gcc -o test5085 test5085.c -ldl
$ gcc -c -fpic test5085_lib.c
$ gcc -shared -o test5085_64_lib.so test5085_lib.o

then load it in gdb:

$ gdb test5085

and...

Python Exception <type 'exceptions.ImportError'> No module named gdb:
/home/etesta/tmp/gdb81_build/gdb/gdb: warning:
Could not load the Python gdb module from `/usr/local/share/gdb/python'.
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.

GNU gdb (GDB) 8.1
Copyright (C) 2018 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-pc-linux-gnu".
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 ./test5085...(no debugging symbols found)...done.

(gdb) break dlsym

Breakpoint 1 at 0x4005e0

(gdb) r ./test5085_64_lib.so

Starting program: /home/etesta/tmp/test5085/test5085 ./test5085_64_lib.so

Breakpoint 1, Python Exception <type 'exceptions.NameError'> Installation
error: gdb.execute_unwinders function is missing:
0x00007ffff7bd4040 in dlsym () from /lib/x86_64-linux-gnu/libdl.so.2


AT THIS POINT REMOVE OR MOVE test5058_64_lib.so

(gdb) c

Continuing.

Program received signal SIGSEGV, Segmentation fault.
Python Exception <type 'exceptions.NameError'> Installation error:
gdb.execute_unwinders function is missing:
BFD: reopening ./test5085_64_lib.so: No such file or directory

BFD: reopening ./test5085_64_lib.so: No such file or directory

(gdb) bt

Segmentation fault (core dumped)

I did a bit of investigation and I noticed that with this issue was already
reported a while back and it was fixed with:

commit 938f0e2f6766e90a5ddc5df00e97a68873fd1252
Author: Andrew Burgess <aburgess@broadcom.com>
Date:   Wed Apr 2 17:02:51 2014 +0100

   Remove previous frame if an error occurs when computing frame id during
unwind.

but then broken by:

commit f245535cf583ae4ca13b10d47b3c7d3334593ece
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Sep 5 18:41:38 2016 +0100

    Fix PR19927: Avoid unwinder recursion if sniffer uses calls parse_and_eval

I keep getting a build failure with the latest git commit on master, so I
didn't try with the latest code.

I am available should you need any more information.

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]