New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seg Fault on OSX when multiprocessing #81858
Comments
Encountered a crash with the following logs. Process: Python [66435] Date/Time: 2019-07-24 21:45:29.722 +0800 Time Awake Since Boot: 1600000 seconds System Integrity Protection: enabled Crashed Thread: 2 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Termination Signal: Segmentation fault: 11 VM Regions Near 0x109b23aa2: Application Specific Information: Thread 2 Crashed: |
Thanks for the report. It would be helpful to have a standalone reproducer for this issue to try reproducing it in 3.6 and other versions. |
Hi, sorry i am unable to provide a standalone script that cause this issue, as it happen once every few weeks. Is it similar to the no_proxy=* issue? |
Hi, I have the exact same issue and same stack trace from getaddrinfo (except Python 2.7). Same as original poster, it only happens every couple of weeks and I don't know how to reproduce. For me it's in an Odoo instance that spawns multiple workers with connections to a postgres database. I think this is a MacOS bug, since the issue does not happen on High Sierra (10.13). |
Looking at the stack trace this is a similar issue as the "no_proxy" one, but in some sense worse because it happens when just calling a regular unix API (not an Apple framework API). The first few lines of the stack trace are for code in the "Network" framework which is new in macOS 10.14 and is based on lib dispatch and hence uses threads. That results in the same problem as the "no_proxy" one: code that causes problems when called after os.fork(). That's a bug in macOS. In Python 3.8 the multiprocessing module switched to "spawn" mode instead of "fork" mode because of this. You can do this manually for earlier versions (https://docs.python.org/3.7/library/multiprocessing.html#contexts-and-start-methods) P.S. A reproducer would still be nice as that would make it easier to raise and issue with Apple about this. |
I'm closing this issue because this crash is caused by a platform issue, and Python 3.8 has a workaround by using a different spawn method in multiprocessing. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: