473,408 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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
Jan 6 '07 #1
3 1289
On 6 ene, 19:45, Hynek Hanke <h...@brailcom.orgwrote:
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.
On Windows, Pythonwin has an option "Break into running code".
Try starting the script with python -i, and send it a signal..

--
Gabriel Genellina

Jan 7 '07 #2
Hynek Hanke wrote:
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.
In python2.5, you can run a background thread that listens on a port or
unix socket, and prints a formatted version of sys._current_frames() to
stderr.

-Mike

Jan 8 '07 #3
Klaas wrote:
Hynek Hanke wrote:
>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.
....
In python2.5, you can run a background thread that listens on a port or
unix socket, and prints a formatted version of sys._current_frames() to
stderr.
You can also use the signal module to similar effect. Works well in
Twisted, at least:

http://blog.vrplumber.com/835

HTH,
Mike

--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com

Jan 8 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Oliver Walczak | last post by:
This seems to be a quite difficult approach. Try this: ##################################################################### import traceback class MyTraceback: def __init__(self):...
7
by: Robin Becker | last post by:
def raise_an_error(): a = 3 b = 4 c = 0 try: a = a/c except: import sys, cgitb, traceback, inspect tbt,tbv,tb = sys.exc_info() print...
1
by: Josh Close | last post by:
When sys.excepthook is called, type, value and traceback are passed into it. How do I get the values of traceback? I've tried printing it, but I get the memory location. I'm gussing there are...
1
by: Thomas Guettler | last post by:
Hi, the line numbers of inspect.getinnerframes are different from traceback.format_exception. This results in wrong lines being shown in cgitb. An example is below. I looked at the...
0
by: tryers | last post by:
looks like this is a virus. i think it is some dodgy stuff. i thought it was an image file but no it looks more like an application. be wary of it >-----Original Message----- >Osama Bin Ladin...
5
by: Bob Greschke | last post by:
I want to cause any traceback output from my applications to show up in one of my dialog boxes, instead of in the command or terminal window (between running on Solaris, Linux, OSX and Windows...
8
by: gregpinero | last post by:
I'm running code via the "exec in context" statement within a much larger program. What I would like to do is capture any possible errors and show a pretty traceback just like the Python...
1
by: Sami Vaisanen | last post by:
This is becoming utterly painful process.... I found out that the return value from "format_exception" function is NOT a list, i.e. PyList_Check() fails. PySequence_Check() succeeds but then...
0
by: jairathore | last post by:
Hi, I m working on a project on which my requirment is like that remotely i control another application by using sendkey.sendwait method, i m sending some keystroke to that application and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.