[issue43832] asyncio + multiprocessing = core dump in sem_trywait
Kunal
report at bugs.python.org
Tue Jun 29 10:29:49 EDT 2021
Kunal <bhalla.kunal at gmail.com> added the comment:
I was trying to reproduce the problem and can get the core dump to happen with a smaller program as well -- it doesn't seem related to asyncio specifically but seems to be a bug with multiprocessing.Event (or probably the primitives inside it).
```
#!/usr/bin/env python
import time
import multiprocessing
def master_func(event) -> None:
print(f"Child: {event = }")
print(f"Child: {event.is_set() = }") # Crashes here with SIGSEGV in sem_trywait
print("Completed")
if __name__ == "__main__":
event = multiprocessing.Event()
context_spawn = multiprocessing.get_context("spawn")
proc = context_spawn.Process(target=master_func, args=(event, ))
proc.start()
print(f"Parent: {event = }")
print(f"Parent: {event.is_set() = }")
proc.join()
```
Switching to fork instead of spawn bypasses the issue. Trying to dig into this a little bit more.
----------
nosy: +knl
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43832>
_______________________________________
More information about the Python-bugs-list
mailing list