Debugging Python extensions with gdb

Andrew Wilkinson ajw140NO at
Fri Jul 9 20:51:03 CEST 2004


Below is a back trace from a gdb session. If you look at you'll see that
there are some function calls where gdb can't find the name of the
function. I'm pretty sure that those functions are in my extension. I've
got everything compiled with debugging info turned on, so I'm pretty sure
it is related to the "Unable to find dynamic linker breakpoint function"
message. Does anyone know how to get rid of this message? I tried googling,
but nothing useful turned up.

Thanks in advance for any help,
Andrew Wilkinson

andrew at andrew tests $ gdb --args python
GNU gdb 6.1.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db
library "/lib/".

(gdb) run
Starting program: /usr/bin/python
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
about to init Devil
No error

Program received signal SIGSEGV, Segmentation fault.
0x4006ea73 in PyObject_GetAttrString () from /usr/lib/
(gdb) bt
#0  0x4006ea73 in PyObject_GetAttrString ()
from /usr/lib/
#1  0x404dc1ed in ?? ()
#2  0x00000000 in ?? ()
#3  0x404eb6cd in ?? ()
#4  0xbfffef5c in ?? ()
#5  0x400f2fbc in __JCR_LIST__ () from /usr/lib/
#6  0x4006a928 in lookdict_string () from /usr/lib/
#7  0x404c7aba in ?? ()
#8  0xbffff07c in ?? ()
#9  0xbffff0ac in ?? ()
#10 0x00000007 in ?? ()
#11 0xbffff07c in ?? ()
#12 0x40061579 in function_call () from /usr/lib/
#13 0x4006cd58 in PyCFunction_Call () from /usr/lib/
#14 0x40094bc3 in call_function () from /usr/lib/
#15 0x40092f8d in eval_frame () from /usr/lib/
#16 0x40093d5f in PyEval_EvalCodeEx () from /usr/lib/
#17 0x40091277 in PyEval_EvalCode () from /usr/lib/
#18 0x400aaf8f in run_node () from /usr/lib/
#19 0x400aa2fe in PyRun_SimpleFileExFlags ()
from /usr/lib/
#20 0x400a9df4 in PyRun_AnyFileExFlags () from /usr/lib/
#21 0x400af3b5 in Py_Main () from /usr/lib/
#22 0x0804867e in main ()

Tis better to be silent and thought a fool, than to open
your mouth and remove all doubt -- Abraham Lincoln

More information about the Python-list mailing list