Which python version and system are you seeing this on?
On 3.11 on a Mac I don't get a segfault but rather
Process SpawnProcess-1:
Traceback (most recent call last):
File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/process.py", line 315, in _bootstrap
self.run()
^^^^^^^^^^
File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/iritkatriel/src/cpython/tt.py", line 6, in wait_for_event
while not event.is_set():
^^^^^^^^^^^^^^
File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/synchronize.py", line 328, in is_set
with self._cond:
^^^^^^^^^^^^^^^^
File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/synchronize.py", line 230, in __enter__
return self._lock.__enter__()
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/iritkatriel/src/cpython/Lib/multiprocessing/synchronize.py", line 95, in __enter__
return self._semlock.__enter__()
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 9] Bad file descriptor
<SpawnProcess name='SpawnProcess-1' pid=29612 parent=29610 stopped exitcode=1>
|