pythonic backtrace with gdb
Hello, please, I'm trying to obtain a pythonic backtrace via gdb to be able to debug deadlock situations in a multi-threaded program by attaching to the running process. I'm running the program under python2.4-dbg, When I try to load the .gdbinit script obtained at http://wiki.python.org/moin/DebuggingWithGdb , gdb crashes however with the following error (full session listing): (gdb) attach 10753 Attaching to program: /usr/bin/python, process 10753 warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff575fd000 0x2b33537177fb in ?? () from /lib64/ld-linux-x86-64.so.2 (gdb) pystack /tmp/buildd/gdb-6.6.dfsg.90.20070912/gdb/regcache.c:164: internal-error: register_type: Assertion `regnum >= 0 && regnum < descr->nr_cooked_registers' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) [answered Y; input not from terminal] /tmp/buildd/gdb-6.6.dfsg.90.20070912/gdb/regcache.c:164: internal-error: register_type: Assertion `regnum >= 0 && regnum < descr->nr_cooked_registers' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Create a core file of GDB? (y or n) [answered Y; input not from terminal] Neúspěšně ukončen (SIGABRT) I've also tried to use the backtrace script here http://mashebali.com/?Python_GDB_macros:The_Macros:Backtrace But I get a different error: (gdb) pbt Invalid type combination in ordering comparison. I'm using GDB version 6.6.90. Could you please suggest what can I do to be able to get the backtrace? Thank you, Hynek Hanke -- http://mail.python.org/mailman/listinfo/python-list
pdb attach?
Hello, please, is there something like 'attach' in pdb yet? My application uses threads and when it freezes (e.g. due to a deadlock situation), I'd like to get the traceback of all threads and inspect at which point did the application get into problems. Or could I send a signal to such a python process so that it would output backtraces from all threads before terminating? Because currently, if a thread runs into deadlock problems (or a thread fails on an exception and the other thread can't join it), I have no way of determining what went wrong. Such processes are not possible to terminate via CTRL-C in the interpreter, so I can't get the backtrace this way. Furthermore, I also need to debug subprocesses, so these are difficult to invoke interactively. I'm happy for any suggestions. Thank you, Hynek Hanke -- http://mail.python.org/mailman/listinfo/python-list
pdb attach?
Hello, please, is there something like 'attach' in pdb yet? My application uses threads and when it freezes (e.g. due to a deadlock situation), I'd like to get the traceback of all threads and inspect at which point did the application get into problems. Or could I send a signal to such a python process so that it would output backtraces from all threads before terminating? Because currently, if a thread runs into deadlock problems (or a thread fails on an exception and the other thread can't join it), I have no way of determining what went wrong. Such processes are not possible to terminate via CTRL-C in the interpreter, so I can't get the backtrace this way. Furthermore, I also need to debug subprocesses, so these are difficult to invoke interactively. I'm happy for any suggestions. Thank you, Hynek Hanke -- http://mail.python.org/mailman/listinfo/python-list
Traceback of hanged process
Hello, please, how do I create a pythonic traceback from a python process that hangs and is not running in an interpreter that I executed manually or it is but doesn't react on CTRL-C etc? I'm trying to debug a server implemented in Python, so I need some analog of 'gdb attach' for C. Unfortunatelly, googling and reading documentation revealed nothing, so please excuse if this question is dumb. Thank you, Hynek Hanke -- http://mail.python.org/mailman/listinfo/python-list