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 backtrace/22733] New: Segfault in frame_unwind_pc when attempting to show backtrace


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

            Bug ID: 22733
           Summary: Segfault in frame_unwind_pc when attempting to show
                    backtrace
           Product: gdb
           Version: 8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: backtrace
          Assignee: unassigned at sourceware dot org
          Reporter: b7.10110111 at gmail dot com
  Target Milestone: ---

This happens on GNU gdb (GDB) 8.1.50.20180119-git, but doesn't on GDB 7.7.1
shipped with Kubuntu 14.04, and up until
5fdf6324fafd60f967e2e8323fdacf84b1bfcea3, where it hits some other crash.

I reproduce this with the following test Qt5 program:

# gdb-crash.pro file
TEMPLATE = app
TARGET = gdb-crash
QT += xmlpatterns
SOURCES += test.cpp

// test.cpp
#include <QXmlSchemaValidator>
int main()
{
    QXmlSchemaValidator().validate("");
}

Compile it as follows:
qmake-qt5 CONFIG+=debug && make

Then run GDB inside another GDB to catch the crash of the inner one:

gdb -ex r --args gdb -q -ex 'catch throw' -ex r -ex bt -ex q ./gdb-crash

After this command I get the following result (skipped irrelevant beginning):

Thread 1 "gdb-crash" hit Catchpoint 1 (exception thrown), 0x00007ffff7215450 in
__cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#0  0x00007ffff7215450 in __cxa_throw () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007ffff7ad86e7 in QPatternist::ReportContext::createError
(this=this@entry=0x6550a0, description="Premature end of document.",
type=type@entry=QtFatalMsg, id=
Program received signal SIGSEGV, Segmentation fault.
0x00000000006b4e6c in frame_unwind_pc (this_frame=0x440000004f) at
../../binutils-gdb/gdb/frame.c:857
857       if (this_frame->prev_pc.status == CC_UNKNOWN)


Backtrace of this crash:
#0  0x00000000006b4e6c in frame_unwind_pc (this_frame=0x440000004f) at
../../binutils-gdb/gdb/frame.c:857
#1  0x00000000006b7f38 in get_frame_pc (frame=0x3572720) at
../../binutils-gdb/gdb/frame.c:2379
#2  0x00000000006b807f in get_frame_address_in_block (this_frame=0x3572720) at
../../binutils-gdb/gdb/frame.c:2410
#3  0x0000000000631c09 in loclist_read_variable (symbol=0x3c48f70,
frame=0x3572720) at ../../binutils-gdb/gdb/dwarf2loc.c:4452
#4  0x00000000006b1db1 in default_read_var_value (var=0x3c48f70, var_block=0x0,
frame=0x3572720) at ../../binutils-gdb/gdb/findvar.c:612
#5  0x00000000006b27e6 in read_var_value (var=0x3c48f70, var_block=0x0,
frame=0x3572720) at ../../binutils-gdb/gdb/findvar.c:815
#6  0x00000000007d1c73 in read_frame_arg (sym=0x3c48f70, frame=0x3572720,
argp=0x7fffffffcc10, entryargp=0x7fffffffcc30) at
../../binutils-gdb/gdb/stack.c:349
#7  0x00000000007d28fa in print_frame_args (func=0x3c48d00, frame=0x3572720,
num=-1, stream=0x124d770) at ../../binutils-gdb/gdb/stack.c:681
#8  0x00000000007d3a49 in print_frame (frame=0x3572720, print_level=1,
print_what=LOCATION, print_args=1, sal=...) at
../../binutils-gdb/gdb/stack.c:1203
#9  0x00000000007d2f09 in print_frame_info (frame=0x3572720, print_level=1,
print_what=LOCATION, print_args=1, set_current_sal=0) at
../../binutils-gdb/gdb/stack.c:860
#10 0x00000000007d522a in backtrace_command_1 (count_exp=0x0, show_locals=0,
no_filters=0, from_tty=1) at ../../binutils-gdb/gdb/stack.c:1807
#11 0x00000000007d55df in backtrace_command (arg=0x0, from_tty=1) at
../../binutils-gdb/gdb/stack.c:1903
#12 0x0000000000477276 in do_const_cfunc (c=0x11e5890, args=0x0, from_tty=1) at
../../binutils-gdb/gdb/cli/cli-decode.c:106
#13 0x000000000047a1b6 in cmd_func (cmd=0x11e5890, args=0x0, from_tty=1) at
../../binutils-gdb/gdb/cli/cli-decode.c:1886
#14 0x000000000082ccd9 in execute_command (p=0x7fffffffd978 "", from_tty=1) at
../../binutils-gdb/gdb/top.c:630
#15 0x0000000000724b93 in catch_command_errors (command=0x82c916
<execute_command(char const*, int)>, arg=0x7fffffffd976 "bt", from_tty=1) at
../../binutils-gdb/gdb/main.c:378
#16 0x0000000000725e1d in captured_main_1 (context=0x7fffffffd410) at
../../binutils-gdb/gdb/main.c:1125
#17 0x0000000000725f1f in captured_main (data=0x7fffffffd410) at
../../binutils-gdb/gdb/main.c:1146
#18 0x0000000000725ff6 in gdb_main (args=0x7fffffffd410) at
../../binutils-gdb/gdb/main.c:1172
#19 0x000000000041013d in main (argc=11, argv=0x7fffffffd518) at
../../binutils-gdb/gdb/gdb.c:32

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