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.

classification
Title: multiprocessing initializer error with CPython 3.9.6 on Apple Silicon
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ronaldoussoren, zhangzheng
Priority: normal Keywords:

Created on 2021-11-10 16:47 by zhangzheng, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg406108 - (view) Author: Zhang Zheng (zhangzheng) Date: 2021-11-10 16:47
Hi, I have encountered an error when working with concurrent.futures.ProcessPoolExecutor API, with CPython 3.9.6 on Apple Silicon, the error can not be reproduced with CPython 3.9.6 Linux/X86 build, so I think this might be related to the arch.

I have created a github repo with the code in poc.py file, and the error message in README, please let me know if there's anything more I can provide to help the investigation to the problem.
msg406109 - (view) Author: Zhang Zheng (zhangzheng) Date: 2021-11-10 16:48
Hi, I have encountered an error when working with concurrent.futures.ProcessPoolExecutor API, with CPython 3.9.6 on Apple Silicon, the error can not be reproduced with CPython 3.9.6 Linux/X86 build, so I think this might be related to the arch.

I have created a github repo with the code in poc.py file, and the error message in README, please let me know if there's anything more I can provide to help the investigation to the problem. 

https://github.com/simsicon/multiprocessing-initializer
msg406155 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2021-11-11 11:21
Please include reproducer code in the issue itself, not on some external side.

That said, the error you're getting is related to the start method used by multiprocessing. On Linux the start method is fork, on macOS (and Windows) the start method is spawn.  The latter requires that data that's passed to the subprocess can be pickled.

We use the "spawn" method on macOS because forking without calling execv is unsafe on macOS when higher level system APIs are used.
History
Date User Action Args
2022-04-11 14:59:52adminsetgithub: 89937
2021-12-10 09:41:02iritkatrielsetstatus: pending -> closed
2021-11-11 11:21:31ronaldoussorensetstatus: open -> pending

nosy: + ronaldoussoren
messages: + msg406155

resolution: not a bug
stage: resolved
2021-11-10 16:48:31zhangzhengsetmessages: + msg406109
2021-11-10 16:47:54zhangzhengcreate