More info on my Python problem...

Peter Otten __peter__ at web.de
Tue Dec 16 04:32:42 EST 2003


JD wrote:

> This is more details about my problem,   which I already managed
> to post as a Python bug to Sourceforge
> 
> This problem is not related to the bug I encountered earlier,  and
> this is related to a question I have about Python hanging up
> either from a shell,  or my importing a module.
> 
> I want to figure out if this really IS a python bug,   but I suspect
> that if it hangs up the console,  it would be a bug.
> 
>   Is there someone who I might contact
> via phone to walk me through this? (Assuming I can't get adequate
> information here? Or does anyone care about Python bugs?) This is in
> Python 2.3.3c1 on OpenBSD (though I doubt the OS matters). The symptom
> is
> that I run my program and Python locks up. I cannot control-C or
> control-D
> to get out of it; I have to log in separately and kill -9 the process.
> The
> process is listed as "D+" while it is hung, though it doesn't seem to be
> accessing the disk, and I'm quite sure there are no disk problems
> (though
> I'm not physically next to the server, so I can't check the drive LED).
> 
> How should I approach debugging this? Are there Python tools? Or should
> I
> use gdb? ktrace? systrace? I'm assuming I have to do this, as a bug
> report
> which reads "Python locks up" isn't to useful.

Can you make a small variant of your program that still shows the error/bug?
Chances are that in the process of making such a variant you will find the
error yourself. If not, you have something that lends itself to posting on
c.l.py. Only if no one here can point you to an error in your code, you
should file a bug report. 

Here is a script that shows similar behaviour:

import threading, time

def forever():
    while True:
        print "alive and kicking"
        time.sleep(1)

threading.Thread(target=forever).start()

The print statement makes it pretty clear what's going on when you run it.
Putting print before/after access of external resources and into inner
loops should make it clear where your program hangs.

Peter







More information about the Python-list mailing list