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

Mac fork() fatal error #606

Open
ecbrodie opened this issue Nov 25, 2019 · 13 comments
Open

Mac fork() fatal error #606

ecbrodie opened this issue Nov 25, 2019 · 13 comments

Comments

@ecbrodie
Copy link

I suddenly starting running into an issue today on my Rails project where all commands I run that use spring as a preloader, such as rspec or rake fail due to an error similar to this:

objc[8689]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[8689]: +[__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.

This happened right after I upgraded all my Homebrew packages on my Mac machine (Mac OS 10.15.1). I can verify that I was not running into this issue on my machine before I upgraded my Homebrew packages, which rules out the issue being due to an application code change. I can also note that I have deduced this to be a Spring issue because I don't run into this error when I run these commands with Spring disabled, via the DISABLE_SPRING=1 variable.

I'm guessing that one of the upgrades from one of my Homebrew packages is serving as a catalyist for this bug to manifest. I'm unsure of how to track this down myself. Here's my list of Homebrew packages, maybe it'll be useful.

In the meanwhile, I'm using an environment variable workaround I've commonly seen in Google searches, such as from this post, to disable this MacOS check.

@pcriv
Copy link

pcriv commented Nov 27, 2019

Having the same issue 😕

@pcriv
Copy link

pcriv commented Nov 27, 2019

I checked your Hombrew packages against mine and these are the ones we both have:

automake
dep
direnv
exercism
gnupg
htop
libtool
neovim
overmind
postgresql
rsync

@CodingAnarchy
Copy link

CodingAnarchy commented Dec 2, 2019

This appears to be causing me issues as well. Any attempts to connect to Postgres hit a segfault due to some spring incompatibility with something. Of the Homebrew packages already listed, I share:

automake
gnupg
htop
libtool
postgresql
rsync

@CodingAnarchy
Copy link

CodingAnarchy commented Dec 2, 2019

Further information from reporting the issue to the Ruby bug tracker, in case it was a problem deeper in Ruby, it appears to potentially be related to an interaction between spring, Postgres 12, and the pg gem. Their response can be found here: https://bugs.ruby-lang.org/issues/16390

@pcriv
Copy link

pcriv commented Dec 2, 2019

So the issue is either on:

  • The pg gem
  • libpq
  • Something else...

@pcriv
Copy link

pcriv commented Dec 2, 2019

FYI: I tried downgrading to postgresql11 and the issue persisted

@jpaas
Copy link

jpaas commented Dec 2, 2019

I'm also using pg11

@CodingAnarchy
Copy link

Might be related to this cause of segfaults in the pg gem, though I haven't verified: ged/ruby-pg#311

@pcriv
Copy link

pcriv commented Jan 24, 2020

Re-installing PostgreSQL fixed the issue for me. Check ged/ruby-pg#311 (comment)

@mjy
Copy link

mjy commented Aug 25, 2021

Remains an issue for us. When running spring we can randomly get one of two errors. Big Sur, both M1 and different errors on Intel. Concur that all signs point to forking, pg, maybe postgis for us. I've re-installed everything, tried the environment variables on various threads etc, nothing. Should note that identical setup on Linux has no problems.

I can hand off crash logs, the fault, and crash as needed, just ping me.

@jonathansimmons
Copy link

We're seeing this issue still today:

Environment:

  • Mac OS 12.0.1
  • Rails 6.1.3.1,
  • Ruby 3.0.1,
  • Postgres 14 (via Postgress.app)

We've opted to remove Spring as was crashing too much for us.

@berniechiu
Copy link

Recently it's broken again due to
ged/ruby-pg#538 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants