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 python/22748] New: crash from custom unwinder


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

            Bug ID: 22748
           Summary: crash from custom unwinder
           Product: gdb
           Version: 8.0.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at sourceware dot org
  Target Milestone: ---

I wrote a minimal unwinder for libjit.  You can see it here:
http://lists.gnu.org/archive/html/libjit/2018-01/msg00013.html

With an unmodified gdb, this unwinder causes a crash when it
asks for the register "rip" in the pending frame.  See the
(partial) stack trace below.

Reverting this patch:

commit 33cc7d368f420326606695daafd6292e2779c6af
Author: Kevin Buettner <kevinb@redhat.com>
Date:   Tue Sep 27 22:45:19 2016 -0700

... fixes the problem for me.
That is, no more crash, and my unwinder works.

The assert in question is this one:

  gdb_assert (frame_id_p (get_frame_id (next_frame)));

in value_of_register_lazy.


(top-gdb) bt
#0  0x00000000005e0d00 in internal_error(char const*, int, char const*, ...)
(file=0xd76098 "../../binutils-gdb/gdb/frame.c", line=534, fmt=0xca2d0f "%s:
Assertion `%s' failed.") at ../../binutils-gdb/gdb/common/errors.c:51
#1  0x00000000006b5477 in get_frame_id(frame_info*) (fi=0x2acd4a0) at
../../binutils-gdb/gdb/frame.c:534
#2  0x00000000006b34c6 in value_of_register_lazy(frame_info*, int)
(frame=0x2acd560, regnum=16) at ../../binutils-gdb/gdb/findvar.c:298
#3  0x00000000006b360f in value_of_register(int, frame_info*) (regnum=16,
frame=0x2acd560) at ../../binutils-gdb/gdb/findvar.c:274
#4  0x0000000000593ff4 in pending_framepy_read_register(PyObject*, PyObject*)
(self=0x7ffff7f5e290, args=<optimized out>) at
../../binutils-gdb/gdb/python/py-unwind.c:402
#5  0x00007ffff668979e in PyEval_EvalFrameEx () at /lib64/libpython2.7.so.1.0
#6  0x00007ffff668a3f8 in PyEval_EvalCodeEx () at /lib64/libpython2.7.so.1.0
#7  0x00007ffff65d97ee in function_call.lto_priv () at
/lib64/libpython2.7.so.1.0
#8  0x00007ffff65a2a53 in PyObject_Call () at /lib64/libpython2.7.so.1.0
#9  0x00007ffff65ce88e in instancemethod_call.lto_priv () at
/lib64/libpython2.7.so.1.0
#10 0x00007ffff65a2a53 in PyObject_Call () at /lib64/libpython2.7.so.1.0
#11 0x00007ffff665ca2b in slot_tp_call () at /lib64/libpython2.7.so.1.0
#12 0x00007ffff65a2a53 in PyObject_Call () at /lib64/libpython2.7.so.1.0
#13 0x00007ffff6685454 in PyEval_EvalFrameEx () at /lib64/libpython2.7.so.1.0
#14 0x00007ffff668a3f8 in PyEval_EvalCodeEx () at /lib64/libpython2.7.so.1.0
#15 0x00007ffff65d97ee in function_call.lto_priv () at
/lib64/libpython2.7.so.1.0
#16 0x00007ffff65a2a53 in PyObject_Call () at /lib64/libpython2.7.so.1.0
#17 0x00007ffff65a4e5f in PyObject_CallFunctionObjArgs () at
/lib64/libpython2.7.so.1.0
#18 0x0000000000593940 in pyuw_sniffer(frame_unwind const*, frame_info*,
void**) (self=<optimized out>, this_frame=0x2acd560, cache_ptr=0x2acd578) at
../../binutils-gdb/gdb/python/py-unwind.c:539
#19 0x00000000006b915d in frame_unwind_try_unwinder(frame_info*, void**,
frame_unwind const*) (this_frame=0x2acd560, this_cache=0x2acd578,
unwinder=0x34294b0) at ../../binutils-gdb/gdb/frame-unwind.c:106
#20 0x00000000006b951f in frame_unwind_find_by_frame(frame_info*, void**)
(this_frame=0x2acd560, this_cache=0x2acd578) at
../../binutils-gdb/gdb/frame-unwind.c:164

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