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/16491] New: crash in py-framefilter.c


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

            Bug ID: 16491
           Summary: crash in py-framefilter.c
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at redhat dot com

Another py-framefilter crash, different from the previous one.

(top) bt
#0  0x00000036876e5790 in __read_nocancel ()
    at ../sysdeps/unix/syscall-template.S:81
#1  0x0000003687677f28 in _IO_new_file_underflow (fp=
    0x36879b2360 <_IO_2_1_stdin_>) at fileops.c:613
#2  0x0000003687678ece in __GI__IO_default_uflow (fp=
    0x36879b2360 <_IO_2_1_stdin_>) at genops.c:436
#3  0x0000003687673e17 in _IO_getc (fp=0x36879b2360 <_IO_2_1_stdin_>)
    at getc.c:40
#4  0x000000000085f88b in defaulted_query (ctlstr=
    0x1035648 "%s\nQuit this debugging session? ", defchar=0 '\000', args=
    0x7fffffffcbe0) at ../../binutils-gdb/gdb/utils.c:1267
#5  0x000000000085fc30 in query (ctlstr=
    0x1035648 "%s\nQuit this debugging session? ")
    at ../../binutils-gdb/gdb/utils.c:1388
#6  0x000000000085eb3f in internal_vproblem (problem=
    0x1d63630 <internal_error_problem>, file=
    0xff86a0 "../../binutils-gdb/gdb/gdbarch.c", line=4312, fmt=
    0xff866b "%s: Assertion `%s' failed.", ap=0x7fffffffcd78)
    at ../../binutils-gdb/gdb/utils.c:763
#7  0x000000000085ecbd in internal_verror (file=
    0xff86a0 "../../binutils-gdb/gdb/gdbarch.c", line=4312, fmt=
    0xff866b "%s: Assertion `%s' failed.", ap=0x7fffffffcd78)
    at ../../binutils-gdb/gdb/utils.c:820
#8  0x000000000085ed7c in internal_error (file=
    0xff86a0 "../../binutils-gdb/gdb/gdbarch.c", line=4312, string=
    0xff866b "%s: Assertion `%s' failed.")
    at ../../binutils-gdb/gdb/utils.c:830
#9  0x000000000076daaf in gdbarch_auto_charset (gdbarch=0x0)
    at ../../binutils-gdb/gdb/gdbarch.c:4312
#10 0x00000000006e0e70 in target_charset (gdbarch=0x0)
    at ../../binutils-gdb/gdb/charset.c:403
#11 0x00000000006865d4 in unicode_to_target_string (unicode_str=u'instance')
    at ../../binutils-gdb/gdb/python/py-utils.c:151
#12 0x000000000068664d in python_string_to_target_string (obj='instance')
    at ../../binutils-gdb/gdb/python/py-utils.c:180
#13 0x0000000000677b0b in frapy_read_var (self=
    <gdb.Frame at remote 0x23a6e70>, args=('instance',))
    at ../../binutils-gdb/gdb/python/py-frame.c:456
#14 0x000000378fadd281 in call_function (oparg=<optimized out>, pp_stack=
    0x7fffffffd128) at /usr/src/debug/Python-2.7.3/Python/ceval.c:4098
#15 PyEval_EvalFrameEx (f=<optimized out>, throwflag=throwflag@entry=0)
    at /usr/src/debug/Python-2.7.3/Python/ceval.c:2740
#16 0x000000378fadcef1 in fast_function (nk=<optimized out>, na=2, 
    n=<optimized out>, pp_stack=0x7fffffffd328, func=
    <function at remote 0x23ae1b8>)
    at /usr/src/debug/Python-2.7.3/Python/ceval.c:4184
#17 call_function (oparg=<optimized out>, pp_stack=0x7fffffffd328)
    at /usr/src/debug/Python-2.7.3/Python/ceval.c:4119
#18 PyEval_EvalFrameEx (f=f@entry=
    Frame 0x28bf2d0, for file
/home/tromey/gnu/gnome/install/share/glib-2.0/gdb/gobject.py, line 181, in
read_object (self=<SignalFrame(frames=[<FrameDecorator(_base=<gdb.Frame at
remote 0x239de30>) at remote 0x23a6ed0>, <FrameDecorator(_base=<gdb.Frame at
remote 0x23a6ef0>) at remote 0x23a6e50>, <FrameDecorator(_base=<gdb.Frame at
remote 0x23a6e70>) at remote 0x23a6dd0>, <FrameDecorator(_base=<gdb.Frame at
remote 0x23a6df0>) at remote 0x23a6d50>, <FrameDecorator(_base=<gdb.Frame at
remote 0x23a6d70>) at remote 0x23a6cd0>], frame=<...>, _base=<...>) at remote
0x23a6f50>, frame=<...>, name='instance', array=[]), 
    throwflag=throwflag@entry=0)
    at /usr/src/debug/Python-2.7.3/Python/ceval.c:2740
#19 0x000000378faddcbf in PyEval_EvalCodeEx (co=<optimized out>, 
    globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, 
    argcount=argcount@entry=4, kws=0x2808980, kwcount=0, defs=0x23a6aa8, 
    defcount=1, closure=0x0) at /usr/src/debug/Python-2.7.3/Python/ceval.c:3330
---Type <return> to continue, or q <return> to quit---
#20 0x000000378fadc2b3 in fast_function (nk=<optimized out>, na=4, 
    n=<optimized out>, pp_stack=0x7fffffffd5d8, func=
    <function at remote 0x23ae410>)
    at /usr/src/debug/Python-2.7.3/Python/ceval.c:4194
#21 call_function (oparg=<optimized out>, pp_stack=0x7fffffffd5d8)
    at /usr/src/debug/Python-2.7.3/Python/ceval.c:4119
#22 PyEval_EvalFrameEx (f=f@entry=
    Frame 0x2808790, for file
/home/tromey/gnu/gnome/install/share/glib-2.0/gdb/gobject.py, line 219, in
function (self=<SignalFrame(frames=[<FrameDecorator(_base=<gdb.Frame at remote
0x239de30>) at remote 0x23a6ed0>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6ef0>) at remote 0x23a6e50>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6e70>) at remote 0x23a6dd0>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6df0>) at remote 0x23a6d50>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6d70>) at remote 0x23a6cd0>], frame=<...>, _base=<...>) at remote
0x23a6f50>, instances=[], signals=[], frame=<...>,
name='signal_emit_unlocked_R'), throwflag=throwflag@entry=0)
    at /usr/src/debug/Python-2.7.3/Python/ceval.c:2740
#23 0x000000378faddcbf in PyEval_EvalCodeEx (co=<optimized out>, 
    globals=<optimized out>, locals=locals@entry=0x0, args=args@entry=
    0x239db68, argcount=1, kws=kws@entry=0x0, kwcount=kwcount@entry=0, 
    defs=defs@entry=0x0, defcount=defcount@entry=0, closure=0x0)
    at /usr/src/debug/Python-2.7.3/Python/ceval.c:3330
#24 0x000000378fa6d926 in function_call (func=<function at remote 0x23ae5f0>, 
    arg=
    (<SignalFrame(frames=[<FrameDecorator(_base=<gdb.Frame at remote
0x239de30>) at remote 0x23a6ed0>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6ef0>) at remote 0x23a6e50>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6e70>) at remote 0x23a6dd0>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6df0>) at remote 0x23a6d50>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6d70>) at remote 0x23a6cd0>], frame=<...>, _base=<...>) at remote
0x23a6f50>,), kw=0x0)
    at /usr/src/debug/Python-2.7.3/Objects/funcobject.c:526
#25 0x000000378fa49c0e in PyObject_Call (func=func@entry=
    <function at remote 0x23ae5f0>, arg=arg@entry=
    (<SignalFrame(frames=[<FrameDecorator(_base=<gdb.Frame at remote
0x239de30>) at remote 0x23a6ed0>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6ef0>) at remote 0x23a6e50>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6e70>) at remote 0x23a6dd0>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6df0>) at remote 0x23a6d50>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6d70>) at remote 0x23a6cd0>], frame=<...>, _base=<...>) at remote
0x23a6f50>,), kw=kw@entry=0x0)
    at /usr/src/debug/Python-2.7.3/Objects/abstract.c:2529
#26 0x000000378fa58200 in instancemethod_call (func=
    <function at remote 0x23ae5f0>, arg=
    (<SignalFrame(frames=[<FrameDecorator(_base=<gdb.Frame at remote
0x239de30>) at remote 0x23a6ed0>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6ef0>) at remote 0x23a6e50>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6e70>) at remote 0x23a6dd0>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6df0>) at remote 0x23a6d50>, <FrameDecorator(_base=<gdb.Frame at remote
0x23a6d70>) at remote 0x23a6cd0>], frame=<...>, _base=<...>) at remote
0x23a6f50>,), kw=0x0)
    at /usr/src/debug/Python-2.7.3/Objects/classobject.c:2578
#27 0x000000378fa49c0e in PyObject_Call (func=func@entry=
    <instancemethod at remote 0x7ffff1b8d5f0>, arg=arg@entry=(), kw=kw@entry=
    0x0) at /usr/src/debug/Python-2.7.3/Objects/abstract.c:2529
#28 0x000000378fa49cf1 in call_function_tail (callable=
    <instancemethod at remote 0x7ffff1b8d5f0>, args=())
    at /usr/src/debug/Python-2.7.3/Objects/abstract.c:2561
#29 0x000000378fa4a135 in _PyObject_CallMethod_SizeT (o=<optimized out>, name=
    0xfaca65 "function", format=0x0)
    at /usr/src/debug/Python-2.7.3/Objects/abstract.c:2677
#30 0x000000000067a0d9 in py_print_frame (filter=
    <SignalFrame(frames=[<FrameDecorator(_base=<gdb.Frame at remote 0x239de30>)
at remote 0x23a6ed0>, <FrameDecorator(_base=<gdb.Frame at remote 0x23a6ef0>) at
remote 0x23a6e50>, <FrameDecorator(_base=<gdb.Frame at remote 0x23a6e70>) at
remote 0x23a6dd0>, <FrameDecorator(_base=<gdb.Frame at remote 0x23a6df0>) at
remote---Type <return> to continue, or q <return> to quit---
 0x23a6d50>, <FrameDecorator(_base=<gdb.Frame at remote 0x23a6d70>) at remote
0x23a6cd0>], frame=<...>, _base=<...>) at remote 0x23a6f50>, flags=7, 
    args_type=CLI_SCALAR_VALUES, out=0x23d8220, indent=0, 
    levels_printed=0x28446e0)
    at ../../binutils-gdb/gdb/python/py-framefilter.c:1165
#31 0x000000000067ab9c in apply_frame_filter (frame=0x2234bd0, flags=7, 
    args_type=CLI_SCALAR_VALUES, out=0x23d8220, frame_low=0, frame_high=-1)
    at ../../binutils-gdb/gdb/python/py-framefilter.c:1532
#32 0x000000000074ec38 in backtrace_command_1 (count_exp=0x0, show_locals=0, 
    no_filters=0, from_tty=1) at ../../binutils-gdb/gdb/stack.c:1797
#33 0x000000000074f097 in backtrace_command (arg=0x0, from_tty=1)
    at ../../binutils-gdb/gdb/stack.c:1911
#34 0x0000000000646bde in do_cfunc (c=0x221a8b0, args=0x0, from_tty=1)
    at ../../binutils-gdb/gdb/cli/cli-decode.c:107
#35 0x0000000000649d1c in cmd_func (cmd=0x221a8b0, args=0x0, from_tty=1)
    at ../../binutils-gdb/gdb/cli/cli-decode.c:1886
#36 0x000000000085bdd3 in execute_command (p=0x1fac6c2 "", from_tty=1)
    at ../../binutils-gdb/gdb/top.c:458
#37 0x0000000000760337 in command_handler (command=0x1fac6c0 "bt")
    at ../../binutils-gdb/gdb/event-top.c:435
#38 0x00000000007608f6 in command_line_handler (rl=0x2628570 "bt")
    at ../../binutils-gdb/gdb/event-top.c:632
#39 0x00000000008b95f9 in rl_callback_read_char ()
    at ../../binutils-gdb/readline/callback.c:220
#40 0x000000000075fe59 in rl_callback_read_char_wrapper (client_data=0x0)
    at ../../binutils-gdb/gdb/event-top.c:164
#41 0x000000000076024e in stdin_event_handler (error=0, client_data=0x0)
    at ../../binutils-gdb/gdb/event-top.c:375
#42 0x000000000075edde in handle_file_event (data=...)
    at ../../binutils-gdb/gdb/event-loop.c:768
#43 0x000000000075e287 in process_event ()
    at ../../binutils-gdb/gdb/event-loop.c:342
#44 0x000000000075e34e in gdb_do_one_event ()
    at ../../binutils-gdb/gdb/event-loop.c:406
#45 0x000000000075e39f in start_event_loop ()
    at ../../binutils-gdb/gdb/event-loop.c:431
#46 0x000000000075fe8b in cli_command_loop (data=0x0)
    at ../../binutils-gdb/gdb/event-top.c:179
#47 0x000000000075636b in current_interp_command_loop ()
    at ../../binutils-gdb/gdb/interps.c:327
#48 0x000000000075743b in captured_command_loop (data=0x0)
    at ../../binutils-gdb/gdb/main.c:267
#49 0x0000000000754783 in catch_errors (func=0x757420 <captured_command_loop>, 
    func_args=0x0, errstring=0xff5975 "", mask=RETURN_MASK_ALL)
    at ../../binutils-gdb/gdb/exceptions.c:524
#50 0x0000000000758812 in captured_main (data=0x7fffffffe400)
    at ../../binutils-gdb/gdb/main.c:1055
#51 0x0000000000754783 in catch_errors (func=0x7576d7 <captured_main>, 
    func_args=0x7fffffffe400, errstring=0xff5975 "", mask=RETURN_MASK_ALL)
    at ../../binutils-gdb/gdb/exceptions.c:524
#52 0x000000000075883b in gdb_main (args=0x7fffffffe400)
    at ../../binutils-gdb/gdb/main.c:1063
#53 0x0000000000490ef3 in main (argc=2, argv=0x7fffffffe508)
    at ../../binutils-gdb/gdb/gdb.c:33
(top) frame 31
#31 0x000000000067ab9c in apply_frame_filter (frame=0x2234bd0, flags=7, 
    args_type=CLI_SCALAR_VALUES, out=0x23d8220, frame_low=0, frame_high=-1)
    at ../../binutils-gdb/gdb/python/py-framefilter.c:1532
1532          success = py_print_frame (item, flags, args_type, out, 0,
(top) p gdbarch
$1 = (struct gdbarch *) 0x241c690
(top) p python_gdbarch
$2 = (struct gdbarch *) 0x0
(top) up
#32 0x000000000074ec38 in backtrace_command_1 (count_exp=0x0, show_locals=0, 
    no_filters=0, from_tty=1) at ../../binutils-gdb/gdb/stack.c:1797
1797          result = apply_frame_filter (get_current_frame (), flags,
arg_type,



Basically this code calls ensure_python_env before computing the
gdbarch.
I'm working on a patch.

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