Package: python-all-dbg
Version: 2.4.4-6
Severity: normal
Hello,
while packaging processing (a python module to use processes like
threads) I've faced a strange error: running tests with python2.{4,5} no
problem, but using -dbg version an error comes out "Fatal Python error:
Invalid thread state for this thread".
Richard (upstream author of processing) kindly provided me a small test
python program to spot the problem (dbg.py attached to this report):
[EMAIL PROTECTED]:~$ python2.4 ~/tmp/dbg.py
parent sleeping ...
child sleeping ...
... child waking
child exiting
... parent waking
parent exiting
[EMAIL PROTECTED]:~$ python2.5 ~/tmp/dbg.py
parent sleeping ...
child sleeping ...
... parent waking
... child waking
child exiting
parent exiting
[EMAIL PROTECTED]:~$ python2.4-dbg ~/tmp/dbg.py
parent sleeping ...
Fatal Python error: Invalid thread state for this thread
... parent waking
parent exiting
[7951 refs]
[EMAIL PROTECTED]:~$ python2.5-dbg ~/tmp/dbg.py
parent sleeping ...
Fatal Python error: Invalid thread state for this thread
... parent waking
parent exiting
[9809 refs]
The behaviour of python2.{4,5} is the intended one, while with -dbg the error
appears.
It could be due to my arch (amd64), an issue on packaging or something deeper
in python code.
Thanks,
Sandro
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.22-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages python-all-dbg depends on:
ii python-all 2.4.4-6 Package depending on all supported
ii python-dbg 2.4.4-6 Debug Build of the Python Interpre
ii python2.4-dbg 2.4.4-6 Debug Build of the Python Interpre
ii python2.5-dbg 2.5.1-5 Debug Build of the Python Interpre
python-all-dbg recommends no packages.
-- no debconf information
import os
import time
from threading import Thread
process = "parent"
def f():
print "%s sleeping ..." % process
time.sleep(2)
print "... %s waking" % process
pt = Thread(target=f)
pt.start()
pid = os.fork()
if pid == 0:
process = "child"
ct = Thread(target=f)
ct.start()
ct.join()
print "child exiting"
os._exit(0)
pt.join()
os.waitpid(pid, 0)
print "parent exiting"