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.

Author kemingy
Recipients docs@python, kemingy
Date 2021-09-27.01:33:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1632706394.95.0.366136047801.issue45298@roundup.psfhosted.org>
In-reply-to
Content
Code to trigger this problem:

```python
import multiprocessing as mp
from time import sleep


def wait_for_event(event):
    while not event.is_set():
        sleep(0.1)


def trigger_segment_fault():
    event = mp.get_context("fork").Event()
    p = mp.get_context("spawn").Process(target=wait_for_event, args=(event,))
    p.start()  # this will show the exitcode=-SIGSEGV
    sleep(1)
    print(p)
    event.set()
    p.terminate()


if __name__ == "__main__":
    trigger_segment_fault()
```

Accessing this forked event in a spawned process will result in a segment fault.

I have found a related report: https://bugs.python.org/issue43832. But I think it's not well documented in the Python 3 multiprocessing doc.

Will it be better to explicit indicate that the event is related to the start method context in the documentation?
History
Date User Action Args
2021-09-27 01:33:14kemingysetrecipients: + kemingy, docs@python
2021-09-27 01:33:14kemingysetmessageid: <1632706394.95.0.366136047801.issue45298@roundup.psfhosted.org>
2021-09-27 01:33:14kemingylinkissue45298 messages
2021-09-27 01:33:14kemingycreate