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/19438] New: dir(objfile) leads to a segmentation fault


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

            Bug ID: 19438
           Summary: dir(objfile) leads to a segmentation fault
           Product: gdb
           Version: 7.10
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: kevin.pouget at gmail dot com
  Target Milestone: ---

with any inferior with debugging symbols:

(gdb) start
(gdb) python print(dir(gdb.selected_frame().function().symtab.objfile))
[1]    1830 segmentation fault (core dumped)  /usr/bin/gdb -nx a.out

Tested on GDB 7.10.1 (archlinux)

Stacktrace with GDB 7.9.50.20150505-cvs:

#0  0x0000000000504b0b in gdb_py_generic_dict (self=0x7f29b20cdae0,
closure=0xc12b20 <objfile_object_type>) at ../../gdb/gdb/python/py-utils.c:429
#1  0x00007f29b3175cf2 in getset_get () at /usr/lib/libpython2.7.so.1.0
#2  0x00007f29b319fb91 in _PyObject_GenericGetAttrWithDict () at
/usr/lib/libpython2.7.so.1.0
#3  0x00007f29b319f3a8 in PyObject_GetAttrString () at
/usr/lib/libpython2.7.so.1.0
#4  0x00007f29b31a0a7e in PyObject_Dir () at /usr/lib/libpython2.7.so.1.0
#5  0x00007f29b31f8019 in builtin_dir () at /usr/lib/libpython2.7.so.1.0
#6  0x00007f29b32022be in PyEval_EvalFrameEx () at /usr/lib/libpython2.7.so.1.0
#7  0x00007f29b3205393 in PyEval_EvalCodeEx () at /usr/lib/libpython2.7.so.1.0
#8  0x00007f29b32054cc in PyEval_EvalCode () at /usr/lib/libpython2.7.so.1.0
#9  0x00007f29b32204f3 in run_mod () at /usr/lib/libpython2.7.so.1.0
#10 0x00007f29b32213e9 in PyRun_StringFlags () at /usr/lib/libpython2.7.so.1.0
#11 0x00007f29b3222e7f in PyRun_SimpleStringFlags () at
/usr/lib/libpython2.7.so.1.0
#12 0x00000000004ef20a in python_command (arg=<optimized out>,
from_tty=<optimized out>) at ../../gdb/gdb/python/python.c:484
#13 0x0000000000676b96 in execute_command (p=<optimized out>, p@entry=0x10051a0
"python print(dir(gdb.selected_frame().function().symtab.objfile))",
from_tty=1) at ../../gdb/gdb/top.c:476
#14 0x00000000005b42e5 in command_handler (command=0x10051a0 "python
print(dir(gdb.selected_frame().function().symtab.objfile))") at
../../gdb/gdb/event-top.c:494
#15 0x00000000005b49e7 in command_line_handler (rl=<optimized out>) at
../../gdb/gdb/event-top.c:692
#16 0x00000000006c40c3 in rl_callback_read_char () at
../../gdb/readline/callback.c:220
#17 0x00000000005b4349 in rl_callback_read_char_wrapper (client_data=<optimized
out>) at ../../gdb/gdb/event-top.c:171
#18 0x00000000005b4393 in stdin_event_handler (error=<optimized out>,
client_data=0x0) at ../../gdb/gdb/event-top.c:432
#19 0x00000000005b32ec in gdb_wait_for_event (block=block@entry=1) at
../../gdb/gdb/event-loop.c:773
#20 0x00000000005b3499 in gdb_do_one_event () at ../../gdb/gdb/event-loop.c:309
#21 0x00000000005b35ce in start_event_loop () at ../../gdb/gdb/event-loop.c:333
#22 0x00000000005ad523 in captured_command_loop (data=data@entry=0x0) at
../../gdb/gdb/main.c:318
#23 0x00000000005aa9ad in catch_errors (func=func@entry=0x5ad510
<captured_command_loop>, func_args=func_args@entry=0x0,
errstring=errstring@entry=0x7986c1 "", mask=mask@entry=RETURN_MASK_ALL) at
../../gdb/gdb/exceptions.c:240
#24 0x00000000005ae5d6 in captured_main (data=data@entry=0x7ffdb85abbc0) at
../../gdb/gdb/main.c:1158
#25 0x00000000005aa9ad in catch_errors (func=func@entry=0x5ad980
<captured_main>, func_args=func_args@entry=0x7ffdb85abbc0,
errstring=errstring@entry=0x7986c1 "", mask=mask@entry=RETURN_MASK_ALL) at
../../gdb/gdb/exceptions.c:240
#26 0x00000000005ae8ab in gdb_main (args=args@entry=0x7ffdb85abbc0) at
../../gdb/gdb/main.c:1166
#27 0x0000000000460755 in main (argc=<optimized out>, argv=<optimized out>) at
../../gdb/gdb/gdb.c:32

Program received signal SIGSEGV, Segmentation fault.
gdb_py_generic_dict (self=0x7f29b20cdae0, closure=0xc12b20
<objfile_object_type>) at ../../gdb/gdb/python/py-utils.c:429
429       Py_INCREF (result);

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