This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_socketserver: Fatal error: Invalid thread state
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: mhammond Nosy List: barry, jcea, mhammond, nnorwitz
Priority: high Keywords:

Created on 2003-05-26 14:30 by nnorwitz, last changed 2022-04-10 16:08 by admin. This issue is now closed.

Messages (7)
msg16165 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-05-26 14:30
Mark, I believe this started happening on Solaris 8
(only AFAIK) after some of your thread changes.  Do you
have access to a Solaris 8 box?  I can try to debug if
you give me some ideas.  This is happening on the snake
farm.  Actually, we have a Sol8 box here.  I can try to
fire it up and see if the problem exists on that box. 
If so, I can give you access.

When running test_socketserver, some way through the
test there's the fatal error.

Fatal Python error: Invalid thread state for this thread

Let me know what more info I can provide.  Sorry, short
on ideas/time, just wanted to get this documented.
msg16166 - (view) Author: Mark Hammond (mhammond) * (Python committer) Date: 2003-07-08 04:39
Logged In: YES 
user_id=14198

I don't have access to a sol8 box, nor would I really know
what to do when I got there :)  Any chance of a stack-trace?
msg16167 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-07-10 04:08
Logged In: YES 
user_id=33168

Doesn't seem real helpful.  I'll see if I can do more on this.

#0  PyThreadState_Swap (new=0x2b1160) at Python/pystate.c:274
#1  PyEval_RestoreThread (tstate=0x2b1160) at Python/ceval.c:391
#2  floatsleep (secs=0) at Modules/timemodule.c:831
#3  time_sleep (self=0x0, args=0x2b3968) at
Modules/timemodule.c:208
#4  PyCFunction_Call (func=0x2bd938, arg=0x2b3968, kw=0x0)
at Objects/methodobject.c:73
#5  call_function (pp_stack=0xdf142f04, oparg=1) at
Python/ceval.c:3439
#6  eval_frame (f=0x2890c8) at Python/ceval.c:2116
msg16168 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-07-10 04:25
Logged In: YES 
user_id=33168

I changed the DELAY in the test to be zero.  The test fails,
but it's interesting that it also hangs in
lock_PyThread_acquire_lock (line 63):

Lib/threading.py (195): wait
Lib/threading.py (468): join
Lib/threading.py (564): __exitfunc
Lib/atexit.py (11): _run_exitfuncs

In looking at threadmodule.c I notice that most of the time 
Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS is not used
around PyThread_acquire_lock, but it is in
lock_PyThread_acquire_lock.  I'm not sure all of these are safe.

Here's some more detail on the Sun:

test_socketserver
ADDR = ('localhost', 17231)
CLASS = SocketServer.ForkingTCPServer
server created
thread: creating server
server running
thread: serving three times
test client 0
Fatal Python error: Invalid thread state for this thread
msg16169 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2003-07-29 03:59
Logged In: YES 
user_id=12800

What can we do about this for 2.3 final?  Probably nothing
given the deadline.  Lowering the priority.
msg16170 - (view) Author: Jesús Cea Avión (jcea) * (Python committer) Date: 2003-09-26 17:30
Logged In: YES 
user_id=97460

With Python 2.3.1 out, is this bug still alive?
msg16171 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2005-10-02 00:27
Logged In: YES 
user_id=33168

Seeing how this problem was never reproduced, I'm closing it.
History
Date User Action Args
2022-04-10 16:08:54adminsetgithub: 38550
2003-05-26 14:30:51nnorwitzcreate