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

undefined symbol: pthread_atfork #156

Open
Jean-Malan opened this issue May 27, 2021 · 4 comments
Open

undefined symbol: pthread_atfork #156

Jean-Malan opened this issue May 27, 2021 · 4 comments

Comments

@Jean-Malan
Copy link

Hey Team,

I am running a Rails (6.0.3.4) app on my Mac (M1 Chip). This error is persisting and is killing my builds:

ruby: symbol lookup error: /usr/local/bundle/gems/stackprof-0.2.17/lib/stackprof/stackprof.so: undefined symbol: pthread_atfork

I am really struggling to find where / why this error is happening and I'm not sure if its versioning / compatibility issues that it is running into.

@franck
Copy link

franck commented Jul 21, 2021

Hi @Jean-Malan,

Did you find a solution ?

I have the same issue.

@hugohow
Copy link

hugohow commented Aug 2, 2021

I have the same issue

@whalesalad
Copy link

My current solution has been to eliminate stackprof from the Gemfile since it is typically not a production dependency. I am also experiencing this in a Ruby 2.6.8 / Rails 4.x environment.

@maeve
Copy link

maeve commented Mar 5, 2022

Workaround: explicitly add -pthread to the linker flags.

Configure via bundler:

bundle config build.stackprof --with-ldflags=-pthread
bundle install

Or install the gem directly:

gem install stackprof -- --with-ldflags=-pthread

In my case, I was installing stackprof into an ubuntu-based docker image on an arm64 architecture, and had to install the pthreads stubs as a dependency first:

apt-get install libpthread-stubs0-dev

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

5 participants