Skip to content
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

macOS: analytics daemon crashes due to fork related error #4294

Closed
pmrowla opened this issue Jul 28, 2020 · 2 comments · Fixed by #4296
Closed

macOS: analytics daemon crashes due to fork related error #4294

pmrowla opened this issue Jul 28, 2020 · 2 comments · Fixed by #4296
Assignees
Labels
p0-critical Critical issue. Needs to be fixed ASAP.

Comments

@pmrowla
Copy link
Contributor

pmrowla commented Jul 28, 2020

After the daemon changes introduced in #4262 (f799e1e), DVC on macOS crashes when we try to spawn the analytics daemon.

dvc git:f799e1e3 ✩  py:dvc ❯ dvc version
WARNING: Unable to detect supported link types, as cache directory '.dvc/cache' doesn't exist. It is usually auto-created by commands such as `dvc add/fetch/pull/run/import`, but you could create it manually to enable this check.
DVC version: 1.1.11+f799e1
Python version: 3.8.5
Platform: macOS-10.15.6-x86_64-i386-64bit
Binary: False
Package: None
Supported remotes: azure, gdrive, gs, hdfs, http, https, s3, ssh, oss
Repo: dvc, git
Filesystem type (workspace): ('apfs', '/dev/disk1s1')
objc[34576]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[34576]: +[__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.

Screen Shot 2020-07-28 at 4 37 51 PM

Disabling analytics avoids the crash

dvc git:f799e1e3 ✩  py:dvc ❯ dvc config --local core.analytics false
dvc git:f799e1e3 ✩  py:dvc ❯ dvc version
WARNING: Unable to detect supported link types, as cache directory '.dvc/cache' doesn't exist. It is usually auto-created by commands such as `dvc add/fetch/pull/run/import`, but you could create it manually to enable this check.
DVC version: 1.1.11+f799e1
Python version: 3.8.5
Platform: macOS-10.15.6-x86_64-i386-64bit
Binary: False
Package: None
Supported remotes: azure, gdrive, gs, hdfs, http, https, s3, ssh, oss
Repo: dvc, git
Filesystem type (workspace): ('apfs', '/dev/disk1s1')

This problem appears to be related to fork being unsafe in macOS

See related Python issue: https://bugs.python.org/issue33725 and Python 3.8 multiprocessing docs

@triage-new-issues triage-new-issues bot added the triage Needs to be triaged label Jul 28, 2020
@pmrowla
Copy link
Contributor Author

pmrowla commented Jul 28, 2020

As mentioned in the python issue, setting the OBJC_DISABLE_INITIALIZE_FORK_SAFETY env variable before running python/dvc can be used as a workaround, but that doesn't seem like an ideal solution for us

@efiop efiop added the p0-critical Critical issue. Needs to be fixed ASAP. label Jul 28, 2020
@triage-new-issues triage-new-issues bot removed the triage Needs to be triaged label Jul 28, 2020
@efiop
Copy link
Contributor

efiop commented Jul 28, 2020

@pmrowla Thank you for the investigation! 🙏 Quick solution is to continue using Popen on mac and windows. Will take a look.

@efiop efiop self-assigned this Jul 28, 2020
@efiop efiop mentioned this issue Jul 28, 2020
2 tasks
efiop added a commit to efiop/dvc that referenced this issue Jul 28, 2020
Turns out macs are not happy with double-forks without exec.

Fixes iterative#4294
efiop added a commit that referenced this issue Jul 28, 2020
Turns out macs are not happy with double-forks without exec.

Fixes #4294
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p0-critical Critical issue. Needs to be fixed ASAP.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants