GDB crashing because of Python
Kevin Pouget
kevin.pouget@gmail.com
Thu Aug 23 14:30:00 GMT 2012
On Thu, Aug 23, 2012 at 3:55 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Kevin" == Kevin Pouget <kevin.pouget@gmail.com> writes:
>
> Kevin> I notice today a lot for GDB crash because of Python, am I the
> Kevin> only one? (I didn't refresh my git tree since a while, so it
> Kevin> might not be directly related to the last Python patches)
>
> Kevin> It's hard to tell exactly what cause it, but for instance I see
> Kevin> repeatedly:
> [...]
>
> I haven't seen it.
> I updated from CVS just now, rebuilt, and ran the gdb.python tests
> without any problems.
>
> Kevin> I'm on Fedora 17, x86_64, Python seems to be at version 2.7.3, gdb is
> Kevin> up to date against the trunk (7.5.50.20120823-cvs)
>
> I'm still on Fedora 16. I wouldn't expect 17 to have particular
> problems like this though.
>
> What were you doing when you got these crashes? Is it something simple
> that I could try? What happens if you run the gdb.python tests?
>
> Tom
Hello,
> What happens if you run the gdb.python tests?
unfortunately, the run 100% fine ...
> What were you doing when you got these crashes?
just "normal" things, I mean, running code which have been running
fine until today.
> SystemError: /builddir/build/BUILD/Python-2.7.3/Objects/listobject.c:178: bad argument to internal function
this one is triggered in the middle of a Breakpoint callback, so it
appears quite often
> Program received signal SIGSEGV, Segmentation fault.
> PyObject_Malloc (nbytes=32)
> at /usr/src/debug/Python-2.7.3/Objects/obmalloc.c:784
this one is when I want to attach gdb to another gdb instance (gdb2
--pid $(pidof gdb))
and finally:
> Fatal Python error: GC object already tracked
this one appears when I start the inferior execution, and start it again
I've attached the complete stack of this crash (from a third gdb!).
We can see that it crashed while auto-loading
"/usr/lib/debug/usr/bin/gdb-gdb.py", which is the original file from
Fedora gdb package.
I can also see that the stack contains "prompt_hook", I've seen another crash
which was mentioned this file [1], which deals with prompt customization.
It *might* be related, but I'm not sure at all.
Thanks,
Kevin
[1] : http://gitorious.org/misc-gdb-stuff/misc-gdb-stuff/blobs/master/misc_gdb/gaudy_prompt.py
-------------- next part --------------
(gdb) where
#0 0x0000003f19035925 in __GI_raise (sig=sig@entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x0000003f190370d8 in __GI_abort () at abort.c:91
#2 0x0000003f2c4f7b3e in Py_FatalError (msg=msg@entry=
0x3f2c520ae8 "GC object already tracked")
at /usr/src/debug/Python-2.7.3/Python/pythonrun.c:1685
#3 0x0000003f2c4739cb in PyList_New (size=size@entry=0)
at /usr/src/debug/Python-2.7.3/Objects/listobject.c:170
#4 0x0000003f2c4f58a5 in PyArena_New ()
at /usr/src/debug/Python-2.7.3/Python/pyarena.c:143
#5 0x0000003f2c4f793a in PyRun_FileExFlags (fp=fp@entry=
0x478ec40, filename=filename@entry=
0x3d8f910 "/usr/lib/debug/usr/bin/gdb-gdb.py",
start=start@entry=257, globals=globals@entry=
{'GdbOutputFile': <classobj at remote 0x23d8460>, '__builtins__': <module at remote 0x7f0a6e5f4ad0>, '__file__': '\x00\x00\x00\x00/lib/deb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'GdbRemoveReadlineFinder': <classobj at remote 0x23d83f8>, 'init': <module at remote 0x23ff718>, '__package__': None, 'sys': <module at remote 0x7f0a6e5f4b78>, 'GdbOutputErrorFile': <classobj at remote 0x23d84c8>, 'gdb': <module at remote 0x23f5830>, 'prompt_hook': None, '__name__': '__main__', 'GdbSetPythonDirectory': <function at remote 0x23f2758>, 'os': <module at remote 0x7f0a6e5bacc8>, '__doc__': None},
locals=locals@entry=
{'GdbOutputFile': <classobj at remote 0x23d8460>, '__builtins__': <module at remote 0x7f0a6e5f4ad0>, '__file__': '\x00\x00\x00\x00/lib/deb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'GdbRemoveReadlineFinder': <classobj at remote 0x23d83f8>, 'init': <module at remote 0x23ff718>, '__package__': None, 'sys': <module at remote 0x7f0a6e5f4b78>, 'GdbOutputErrorFile': <classobj at remote 0x23d84c8>, 'gdb': <module at remote 0x23f5830>, 'prompt_hook': None, '__name__': '__main__', 'GdbSetPythonDirectory': <function at remote 0x23f2758>, 'os': <module at remote 0x7f0a6e5bacc8>, '__doc__': None},
closeit=closeit@entry=0, flags=flags@entry=0x0)
at /usr/src/debug/Python-2.7.3/Python/pythonrun.c:1335
#6 0x0000003f2c4f83ab in PyRun_SimpleFileExFlags (fp=fp@entry=
0x478ec40, filename=filename@entry=
0x3d8f910 "/usr/lib/debug/usr/bin/gdb-gdb.py",
closeit=closeit@entry=0, flags=flags@entry=0x0)
at /usr/src/debug/Python-2.7.3/Python/pythonrun.c:951
#7 0x00000000004d9b11 in python_run_simple_file (filename=
0x3d8f910 "/usr/lib/debug/usr/bin/gdb-gdb.py", file=
0x478ec40) at ../../../git/gdb/gdb/python/python.c:269
#8 source_python_script_for_objfile (objfile=0x26ed780, file=
0x478ec40, filename=
0x3d8f910 "/usr/lib/debug/usr/bin/gdb-gdb.py")
at ../../../git/gdb/gdb/python/python.c:1134
#9 0x000000000050b1cc in auto_load_objfile_script (
objfile=objfile@entry=0x26ed780, language=language@entry=
0x748390 <script_language_python>)
at ../../../git/gdb/gdb/auto-load.c:770
#10 0x00000000004da3df in gdbpy_load_auto_scripts_for_objfile (
objfile=0x26ed780)
at ../../../git/gdb/gdb/python/py-auto-load.c:233
#11 0x0000000000583d5d in captured_main (data=data@entry=
0x7fffe49b9d30) at ../../../git/gdb/gdb/main.c:964
#12 0x000000000058213e in catch_errors (func=func@entry=
0x583780 <captured_main>, func_args=func_args@entry=
0x7fffe49b9d30, errstring=errstring@entry=0x733ab2 "",
mask=mask@entry=6) at ../../../git/gdb/gdb/exceptions.c:546
#13 0x0000000000584794 in gdb_main (args=args@entry=
0x7fffe49b9d30) at ../../../git/gdb/gdb/main.c:1008
#14 0x000000000045894e in main (argc=<optimized out>,
argv=<optimized out>) at ../../../git/gdb/gdb/gdb.c:34
(gdb)
More information about the Gdb
mailing list