This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: recursion limit exceeded in Python API, but there's only one function in traceback
- From: Ãmer Sinan AÄacan <omeragacan at gmail dot com>
- To: paul_koning <Paul_Koning at dell dot com>
- Cc: pmuldoon <pmuldoon at redhat dot com>, gdb <gdb at sourceware dot org>
- Date: Thu, 16 Oct 2014 18:14:50 +0300
- Subject: Re: recursion limit exceeded in Python API, but there's only one function in traceback
- Authentication-results: sourceware.org; auth=none
- References: <CAMQQO3knCrj=7dQNV1NEJofLhm7gZzvzG55K66uDOJt7qYrjGg at mail dot gmail dot com> <543FBDFF dot 3050709 at redhat dot com> <104DEFBD-D686-4290-8E3C-725A51C165E6 at dell dot com> <CAMQQO3=GxjGzF-9RXQsJ_9=Du3rS-UoYFA_0-friPp1nMa8yAA at mail dot gmail dot com> <7BB30632-15BE-4EF8-B84F-D35A27772F18 at dell dot com>
2014-10-16 18:03 GMT+03:00 <Paul_Koning@dell.com>:
> Is that the handler for a breakpoint? Does the completion of the âsiâ command invoke the breakpoint handler? If yes, thatâs your answer.
>
> paul
Interesting, but I don't think that's causing the problem. I changed
the script to:
import gdb
import traceback
def handler(ev):
try:
print "handling a stop"
gdb.execute("stepi")
gdb.execute("continue")
except:
traceback.print_stack()
gdb.events.stop.connect(handler)
When I first attach to the process, I'm getting:
[..snip..]
handling a stop
0x080eecea in UpdateInput() ()
handling a stop
0x080eecef in UpdateInput() ()
handling a stop
0x080eece0 in UpdateInput() ()
handling a stop
0x080eece7 in UpdateInput() ()
Traceback (most recent call last):
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
traceback.print_stack()
File "/usr/lib64/python2.7/traceback.py", line 269, in print_stack
print_list(extract_stack(f, limit), file)
File "/usr/lib64/python2.7/traceback.py", line 304, in extract_stack
linecache.checkcache(filename)
RuntimeError: maximum recursion depth exceeded
Again a weird "recursion error" with just 3 stack frames.
When I ignore and continue with `c`, it's failing with this:
[.. snip ..]
File "/home/omer/gdb_script/stackoverflow.py", line 7, in handler
gdb.execute("stepi")
File "/home/omer/gdb_script/stackoverflow.py", line 7, in handler
gdb.execute("stepi")
File "/home/omer/gdb_script/stackoverflow.py", line 10, in handler
traceback.print_stack()
File "/home/omer/gdb_script/stackoverflow.py", line 7, in handler
gdb.execute("stepi")
[.. snip ..]
There are thousands of same lines like this.