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

"Segmentation fault" error with the concurrent-ruby gem when trying to run any rails command in the Dev Container on my M2 Mac #283

Closed
leemcalilly opened this issue Feb 3, 2024 · 8 comments
Labels
🐛 Bug Something isn't working

Comments

@leemcalilly
Copy link
Contributor

leemcalilly commented Feb 3, 2024

This could be me being a dumbass about Docker, but my initial googling suggests it might be related to Ruby 3.3.0

A Github Codespace ran Maybe just as the README suggests it should, and Docker is working on my Mac fine with other apps, but when I try to run any rails command I get this error:

Use `bundle info [gemname]` to see where a bundled gem is installed.
root@efff962cfc98:/workspace# bundle exec rails db:setup
/usr/local/bundle/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:14: [BUG] Segmentation fault at 0x003bffffbcfc2b90
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [aarch64-linux]

-- Control frame information -----------------------------------------------
c:0100 p:---- s:0547 e:000546 CFUNC  :resume
c:0099 p:0007 s:0543 E:000ca0 BLOCK  /usr/local/bundle/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:14 [FINISH]
c:0098 p:---- s:0540 e:000539 CFUNC  :synchronize
c:0097 p:0026 s:0536 E:000588 METHOD /usr/local/bundle/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:12
c:0096 p:0007 s:0531 e:000530 CLASS  /usr/local/bundle/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:18
c:0095 p:0025 s:0528 e:000527 TOP    /usr/local/bundle/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:5 [FINISH]
c:0094 p:---- s:0525 e:000524 CFUNC  :require
c:0093 p:0030 s:0520 e:000519 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0092 p:0131 s:0514 e:000513 METHOD /usr/local/bundle/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30
c:0091 p:0041 s:0505 e:000504 TOP    /usr/local/bundle/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:7 [FINISH]
c:0090 p:---- s:0502 e:000501 CFUNC  :require
c:0089 p:0030 s:0497 e:000496 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0088 p:0131 s:0491 e:000490 METHOD /usr/local/bundle/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30
c:0087 p:0047 s:0482 e:000481 TOP    /usr/local/bundle/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/atomics.rb:8 [FINISH]

Has anyone else experienced this when trying to build the Dev Container on a Mac? I'm on an M2 MacOS14.3?

Normally I would try going back a version of Ruby or a different linux install or something in the Docker file, but that doesn't seem like the right approach for an open source project if I'm the only one experiencing this issue.

@Shpigford Shpigford added the 🐛 Bug Something isn't working label Feb 3, 2024
@robzolkos
Copy link
Contributor

Hey @leemcalilly - I added the devcontainer config into this project and run an M3 Mac. I will try on an M1 Mac and see if this happens there. It may be isolated to M2 (unlikely tbh). Will report back.

@robzolkos
Copy link
Contributor

Yeah I can't replicate on my M1 or M3 (I just updated to 14.3 too). 🤷🏻‍♂️ Let's see if anyone else with an M2 has this #science

@leemcalilly
Copy link
Contributor Author

I'll try to explore this more when I have a minute.

@kobaltz
Copy link

kobaltz commented Feb 4, 2024

There's a known issue on Dockerized Ruby 3.3.0 apps and Apple Silicon. I am currently applying the patch on my apps until Ruby 3.3.1 is released. ruby/ruby#9371 (comment)

@muava12
Copy link

muava12 commented Feb 4, 2024

how to istall this app on Docker? any documentation?

@leemcalilly
Copy link
Contributor Author

There's a known issue on Dockerized Ruby 3.3.0 apps and Apple Silicon. I am currently applying the patch on my apps until Ruby 3.3.1 is released. ruby/ruby#9371 (comment)

I think this is the issue. I can just build my own docker image locally to contribute, but if this is a common problem, it might be worth switching to Ruby 3.2.3 for the near term, so the dev containers work out of the box on every Mac.

@robzolkos
Copy link
Contributor

robzolkos commented Feb 4, 2024

@leemcalilly issue with switching to 3.2.3 in the devcontainer is that it has effects like having to also update the ruby version in the gemfile etc. Gets messy.

Instead I've applied the patch as mentioned by @kobaltz in the devcontainer dockerfile, so we still get Ruby 3.3.0 and it should work without any further changes. Can you kick the tyres on it for me in this branch and see if it works for you #293

@leemcalilly
Copy link
Contributor Author

This PR fixed it @robzolkos #293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants