Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.2k
Closed
Description
Bug report
Bug description:
Fatal Python error: _PySemaphore_PlatformWait: unexpected error from semaphore: 4294967295 (error: 6)Python runtime state: finalizing (tstate=0x6aa6c460)Thread 0x00001360 (most recent call first): <no Python frame>Windows fatal exception: code 0x80000003Current thread 0x00001360 (most recent call first): <no Python frame>Current thread's C stack trace (most recent call first): <cannot get C stack on this system>
4294967295
is the-1
return code fromWaitForMultipleObjects
. Error code 6 isERROR_INVALID_HANDLE
.
I'm pretty sure that the_PyOS_SigintEvent()
handle is getting closed concurrently with the mutex wait.
Lines 118 to 136 in1ffe913
HANDLEsigint_event=_PyOS_SigintEvent(); | |
HANDLEhandles[2]= {sema->platform_sem,sigint_event }; | |
DWORDcount=sigint_event!=NULL ?2 :1; | |
wait=WaitForMultipleObjects(count,handles, FALSE,millis); | |
if (wait==WAIT_OBJECT_0) { | |
res=Py_PARK_OK; | |
} | |
elseif (wait==WAIT_OBJECT_0+1) { | |
ResetEvent(sigint_event); | |
res=Py_PARK_INTR; | |
} | |
elseif (wait==WAIT_TIMEOUT) { | |
res=Py_PARK_TIMEOUT; | |
} | |
else { | |
_Py_FatalErrorFormat(__func__, | |
"unexpected error from semaphore: %u (error: %u)", | |
wait,GetLastError()); | |
} |
Seen inhttps://github.com/python/cpython/actions/runs/15423887404/job/43405853684 at the end of runningtest_decorators
.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows