question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

multiprocessing error when runs on macos big sur

See original GitHub issue

Describe the bug

when sanic starts with multiple session, it crashes as :

objc[96314]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[96315]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[96314]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
objc[96315]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

Code snippet app.run( host=“0.0.0.0”, port=port, workers=sessions, register_sys_signals=True, protocol=WebSocketProtocol, )

Expected behavior No exception, no crash

Environment (please complete the following information):

  • OS: macos big sur, apple m1
  • Version

https://stackoverflow.com/questions/50168647/multiprocessing-causes-python-to-crash-and-gives-an-error-may-have-been-in-progr

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Troniccommented, Nov 16, 2021

I tried it a couple of years back, specifically to fix this problem in Sanic. Found out that this was the case and then looked it up on Stackoverflow or somewhere that others had noticed the same.

0reactions
stale[bot]commented, Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiprocessing is not running on M1 MacBook Air - Big Sur 11.2
When I try to run "backprop_from_fdtd_3d.py" or any other examples which includes multiprocessing codes, terminal shows an error like given below. I checked ......
Read more >
why multiprocess works differently in ubuntu vs macOS?
It appears that this version of macOS has switched over to using the spawn rather than fork method of creating new processes.
Read more >
Issue 33725: Python crashes on macOS after fork with no exec
msg318352 ‑ (view) Author: Kapil Thangavelu (kapilt) Date: 2018‑06‑01 00:53 msg318361 ‑ (view) Author: Ronald Oussoren (ronaldoussoren) * Date: 2018‑06‑01 05:51 msg318396 ‑ (view) Author:...
Read more >
Weird Mistake - Google Groups
I'm using Mac OS Big Sur. After running the code on the the terminal to carry out a participant-level analysis I get the...
Read more >
Help Articles - ENVI & IDL | L3Harris Geospatial
Problem The IDL 8.8.1 Workbench running on macOS 11 Big Sur (or newer versions) with Rosetta 2 on the Apple Silicon / M1...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found