简体   繁体   English

MacOS Catalina Python 分叉问题

[英]MacOS Catalina Python forking issue

I am currently facing the issue, that multiprocessing in python with fork as starting method causes a crash on Catalina.我目前面临的问题是,python 中以 fork 为启动方法的多处理会导致 Catalina 崩溃。 The same Code worked perfectly fine on Mojave, even without the classic workaround OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES .即使没有经典的解决方法OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ,相同的代码在 Mojave 上也能正常工作。 This line does not seem to have any effect in Catalina anyway.无论如何,这条线在 Catalina 中似乎没有任何影响。 The crash does not result in any catchable exception or traceback, so i am very sorry but i cannot provide more information.崩溃不会导致任何可捕获的异常或回溯,所以我很抱歉,但我无法提供更多信息。 It occurs whenever the forked process uses openMP threading, id est spawns threads itself.每当分叉进程使用 openMP 线程时就会发生这种情况,id est 本身会产生线程。 Does anyone know how to fix the forking behaviour on Catalina ?有谁知道如何修复 Catalina 上的分叉行为? Using another starting method is probably not an option since i am dealing with none pickable objects.使用另一种启动方法可能不是一种选择,因为我正在处理不可选择的对象。

its kinda hard to determine your cause without a Crash Report.如果没有崩溃报告,很难确定您的原因。

Attempt this to find your crash reports:尝试通过以下方式找到您的崩溃报告:

Open the Console application: Type “Console” into Spotlight or navigate to “Application -> Utilities -> Console.app.”打开控制台应用程序:在 Spotlight 中输入“控制台”或导航到“应用程序 -> 实用程序 -> Console.app”。 then Click on Crash Reports.然后单击崩溃报告。

I had similar issue, where Python kept crashing when i was running Ansible, on Mojave..the classic fix was to add "export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES"我有类似的问题,当我在 Mojave 上运行 Ansible 时,Python 一直崩溃……经典的修复方法是添加“export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES”

However, with Catalina this was not the fix for me any longer.但是,对于 Catalina,这不再适合我。 I had to deal with missing links to libcrypto openssl on OSX, The openssl this did the trick for me.我不得不处理 OSX 上缺少的 libcrypto openssl 链接,openssl 这对我有用。

Try this script (or run the commands manually) if you indeed have an OpenSSL issue:如果确实存在 OpenSSL 问题,请尝试使用此脚本(或手动运行命令):

https://gist.github.com/cpavlatos/265d5091a89148eec1cfa2d10e200d32 https://gist.github.com/cpavlatos/265d5091a89148eec1cfa2d10e200d32

Note: Prior to running the above script, you might want to cd to /usr/local/Cellar/openssl/ and see what version you have then change the script accordingly.注意:在运行上述脚本之前,您可能需要 cd 到 /usr/local/Cellar/openssl/ 并查看您的版本,然后相应地更改脚本。

Also, worth checking is this thread: https://github.com/Homebrew/homebrew-core/issues/44996#issuecomment-543945199 Summarized better here: https://gist.github.com/llbbl/c54f44d028d014514d5d837f64e60bac#gistcomment-3115206另外,值得检查的是这个线程: https : //github.com/Homebrew/homebrew-core/issues/44996#issuecomment-543945199在这里总结得更好: https : //gist.github.com/llbbl/c54f44d028d014514d5d837f64e60bac311520

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM