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/14135] Fails in gdb.python/py-finish-breakpoint.exp when`set target-async on'.


http://sourceware.org/bugzilla/show_bug.cgi?id=14135

--- Comment #2 from Yao Qi <qiyao at gcc dot gnu.org> 2012-05-23 10:39:45 UTC ---
(In reply to comment #1)
> I took a look at this bug, but the python code **seems** not to be directly
> involved.
> 
> The internal error comes from infrun.c:5973
> 
>   if (last.kind == TARGET_WAITKIND_NO_RESUMED)
>     {
>       gdb_assert (sync_execution || !target_can_async_p ());
> 
>       target_terminal_ours_for_output ();
>       printf_filtered (_("No unwaited-for children left.\n"));
>     }
> 
> and it seems to be related to these messages
> 
>     linux_nat_wait: [process -1]
>     LLW: enter
>     LNW: waitpid(-1, ...) returned 0, No child processes
>     LLW: exit (no resumed LWP)
>     No unwaited-for children left.
> 
> coming from linux-nat.c:3689 (linux_nat_wait_1) ... but I have no clue what to
> do next ...
> 
> 
> Let me know of you have any idea / if there is something I can do

The python code is involved in this way, as this backtrace displayed,


(gdb) bt
#0  linux_nat_wait_1 (ops=0x84a2b58, ptid=..., ourstatus=0xbfffe3e4,
target_options=<value optimized out>) at ../../gdb/gdb/linux-nat.c:3821
#1  linux_nat_wait (ops=0x84a2b58, ptid=..., ourstatus=0xbfffe3e4,
target_options=<value optimized out>) at ../../gdb/gdb/linux-nat.c:4074
#2  0x081ec68b in target_wait (ptid=..., status=0xbfffe3e4, options=1) at
../../gdb/gdb/target.c:2624
#3  0x081bae60 in fetch_inferior_event (client_data=0x0) at
../../gdb/gdb/infrun.c:2789
#4  0x081cffa1 in fetch_inferior_event_wrapper (client_data=0x0) at
../../gdb/gdb/inf-loop.c:145
#5  0x081c68cb in catch_errors (func=0x81cff90 <fetch_inferior_event_wrapper>,
func_args=0x0, errstring=0x8365d81 "", mask=6) at
../../gdb/gdb/exceptions.c:546
#6  0x081cfcf3 in inferior_event_handler (event_type=INF_REG_EVENT,
client_data=0x0) at ../../gdb/gdb/inf-loop.c:53
#7  0x081ce4c2 in handle_file_event (data=...) at
../../gdb/gdb/event-loop.c:827
#8  0x081cdb3b in process_event () at ../../gdb/gdb/event-loop.c:401
#9  0x081ce9d6 in gdb_do_one_event () at ../../gdb/gdb/event-loop.c:453
#10 0x08283497 in execute_command (p=0x85beb0e "1", from_tty=0) at
../../gdb/gdb/top.c:492
#11 0x08113354 in execute_gdb_command (self=0x0, args=0x856240c, kw=0x0) at
../../gdb/gdb/python/python.c:453
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


#12 0x0021dca8 in PyCFunction_Call () from /usr/lib/libpython2.6.so.1.0
#13 0x0027e45e in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#14 0x0027fcbd in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#15 0x00207e97 in ?? () from /usr/lib/libpython2.6.so.1.0
#16 0x001d8edc in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#17 0x001eae34 in ?? () from /usr/lib/libpython2.6.so.1.0
#18 0x001d8edc in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#19 0x001de19e in _PyObject_CallMethod_SizeT () from
/usr/lib/libpython2.6.so.1.0
#20 0x08116f20 in gdbpy_should_stop (bp_obj=0x3a6ff4) at
../../gdb/gdb/python/py-breakpoint.c:735
#21 0x08161b4a in bpstat_check_breakpoint_conditions (aspace=0x8547730,
bp_addr=134514268, ptid=..., ws=0xbfffeef4) at ../../gdb/gdb/breakpoint.c:4713
#22 bpstat_stop_status (aspace=0x8547730, bp_addr=134514268, ptid=...,
ws=0xbfffeef4) at ../../gdb/gdb/breakpoint.c:4938
#23 0x081b8b88 in handle_inferior_event (ecs=0xbfffeee4) at
../../gdb/gdb/infrun.c:4227

#24 0x081babb9 in fetch_inferior_event (client_data=0x0) at
../../gdb/gdb/infrun.c:2817
#25 0x081cffa1 in fetch_inferior_event_wrapper (client_data=0x0) at
../../gdb/gdb/inf-loop.c:145
#26 0x081c68cb in catch_errors (func=0x81cff90 <fetch_inferior_event_wrapper>,
func_args=0x0, errstring=0x8365d81 "", mask=6) at
../../gdb/gdb/exceptions.c:546
#27 0x081cfcf3 in inferior_event_handler (event_type=INF_REG_EVENT,
client_data=0x0) at ../../gdb/gdb/inf-loop.c:53
#28 0x081ce4c2 in handle_file_event (data=...) at
../../gdb/gdb/event-loop.c:827
#29 0x081cdb3b in process_event () at ../../gdb/gdb/event-loop.c:401
#30 0x081ce9d6 in gdb_do_one_event () at ../../gdb/gdb/event-loop.c:453
#31 0x08283497 in execute_command (p=0xbffff5f5 "", from_tty=1) at
../../gdb/gdb/top.c:492
#32 0x081c683a in catch_command_errors (command=0x8283330 <execute_command>,
arg=0xbffff5f4 "c", from_tty=1, mask=6) at ../../gdb/gdb/exceptions.c:573
#33 0x081c8b20 in captured_main (data=0xbffff230) at ../../gdb/gdb/main.c:977
#34 0x081c68cb in catch_errors (func=0x81c8090 <captured_main>,
func_args=0xbffff230, errstring=0x8365d81 "", mask=6) at
../../gdb/gdb/exceptions.c:546
#35 0x081c7de2 in gdb_main (args=0xbffff230) at ../../gdb/gdb/main.c:1010
#36 0x08094cf3 in main (argc=20, argv=0xbffff2f4) at ../../gdb/gdb/gdb.c:34


In frame #11, we can see that it tries to execute a command,  in
gdb.python/py-finish-breakpoint.py, we can see a command "where 1" is used in
MyFinishBreakpoint::stop(self) [1],

class MyFinishBreakpoint (gdb.FinishBreakpoint):
    def __init__(self, val, frame):
        gdb.FinishBreakpoint.__init__ (self, frame)
        print "MyFinishBreakpoint init"
        self.val = val

    def stop(self):
        print "MyFinishBreakpoint stop with %d" % int (self.val.dereference ())
        print "return_value is: %d" % int (self.return_value)
        gdb.execute ("where 1") // <-------- [1]
        return True

    def out_of_scope(self):
        print "MyFinishBreakpoint out of scope"

If remove this line [1], internal error goes away.

The doc says "23.2.2.20 Manipulating breakpoints using Python. ... You should
not alter the execution state of the inferior (i.e., step, next, etc.), alter
the current frame context (i.e., change the current active frame), or alter,
add or delete any breakpoint. As a general rule, you should not alter any data
within gdb or the inferior at this time.".  I doubt "where 1" falls in this
category in async mode.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]