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

Fiber.new causes SEGV when using Ruby 3.3.0 on Rails 7.1.2 in M1 Mac Docker environment #1020

Closed
hachi8833 opened this issue Dec 27, 2023 · 5 comments

Comments

@hachi8833
Copy link

hachi8833 commented Dec 27, 2023

* Operating system:                mac (M1 Macbook Pro 2021, Sonoma 14.2.1)
* Ruby implementation:             Ruby 3.0.0p0
* `concurrent-ruby` version:       1.2.2
* `concurrent-ruby-ext` installed: no
* `concurrent-ruby-edge` used:     no

I encountered a SEGV when running Rails with Ruby 3.3.0 in Docker environment.

  • Ruby: 3.3.0p0
  • Rails: 7.1.2
  • Docker: 24.0.6, build ed223bc
  • Docker Desktop for Mac: 4.25.2 (129061)

Note that Ruby 3.3.0 works fine with Rails 7.1.2 on non-Docker environments.

I hope some of you'd check this 🙏

Error

Error (click to expand)
$ dip rails about
[+] Building 0.0s (0/0)                                                                               docker:desktop-linux
[+] Building 0.0s (0/0)                                                                               docker:desktop-linux
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:14: [BUG] Segmentation fault at 0x0057ffff94e306c0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) +YJIT [aarch64-linux]

-- Control frame information -----------------------------------------------
c:0100 p:---- s:0565 e:000564 CFUNC  :resume
c:0099 p:0007 s:0561 E:001540 BLOCK  /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:14 [FINISH]
c:0098 p:---- s:0558 e:000557 CFUNC  :synchronize
c:0097 p:0026 s:0554 E:000ca8 METHOD /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:12
c:0096 p:0007 s:0549 e:000548 CLASS  /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:18
c:0095 p:0025 s:0546 e:000545 TOP    /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:5 [FINISH]
c:0094 p:---- s:0543 e:000542 CFUNC  :require
c:0093 p:0030 s:0538 e:000537 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0092 p:0158 s:0532 e:000531 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0091 p:0041 s:0522 e:000521 TOP    /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:7 [FINISH]
c:0090 p:---- s:0519 e:000518 CFUNC  :require
c:0089 p:0030 s:0514 e:000513 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0088 p:0158 s:0508 e:000507 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0087 p:0047 s:0498 e:000497 TOP    /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomics.rb:8 [FINISH]
c:0086 p:---- s:0495 e:000494 CFUNC  :require
c:0085 p:0030 s:0490 e:000489 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0084 p:0158 s:0484 e:000483 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0083 p:0029 s:0474 e:000473 TOP    /usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent.rb:6 [FINISH]
c:0082 p:---- s:0471 e:000470 CFUNC  :require
c:0081 p:0030 s:0466 e:000465 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0080 p:0158 s:0460 e:000459 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0079 p:0005 s:0450 e:000449 TOP    /usr/local/bundle/gems/tzinfo-2.0.6/lib/tzinfo/string_deduper.rb:4 [FINISH]
c:0078 p:---- s:0447 e:000446 CFUNC  :require_relative
c:0077 p:0025 s:0442 e:000441 TOP    /usr/local/bundle/gems/tzinfo-2.0.6/lib/tzinfo.rb:25 [FINISH]
c:0076 p:---- s:0439 e:000438 CFUNC  :require
c:0075 p:0030 s:0434 e:000433 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0074 p:0158 s:0428 e:000427 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0073 p:0005 s:0418 e:000417 TOP    /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/values/time_zone.rb:3 [FINISH]
c:0072 p:---- s:0415 e:000414 CFUNC  :require
c:0071 p:0030 s:0410 e:000409 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0070 p:0158 s:0404 e:000403 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0069 p:0017 s:0394 e:000393 TOP    /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/core_ext/time/conversions.rb:5 [FINISH]
c:0068 p:---- s:0391 e:000390 CFUNC  :require
c:0067 p:0030 s:0386 e:000385 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0066 p:0158 s:0380 e:000379 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0065 p:0065 s:0370 e:000369 TOP    /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/core_ext/object/json.rb:14 [FINISH]
c:0064 p:---- s:0367 e:000366 CFUNC  :require
c:0063 p:0030 s:0362 e:000361 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0062 p:0158 s:0356 e:000355 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0061 p:0005 s:0346 e:000345 TOP    /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/json/encoding.rb:3 [FINISH]
c:0060 p:---- s:0343 e:000342 CFUNC  :require
c:0059 p:0030 s:0338 e:000337 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0058 p:0158 s:0332 e:000331 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0057 p:0011 s:0322 e:000321 TOP    /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/json.rb:4 [FINISH]
c:0056 p:---- s:0319 e:000318 CFUNC  :require
c:0055 p:0030 s:0314 e:000313 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0054 p:0158 s:0308 e:000307 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0053 p:0011 s:0298 e:000297 TOP    /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/messages/metadata.rb:4 [FINISH]
c:0052 p:---- s:0295 e:000294 CFUNC  :require_relative
c:0051 p:0011 s:0290 e:000289 TOP    /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/messages/codec.rb:4 [FINISH]
c:0050 p:---- s:0287 e:000286 CFUNC  :require
c:0049 p:0030 s:0282 e:000281 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0048 p:0158 s:0276 e:000275 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0047 p:0023 s:0266 e:000265 TOP    /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/message_encryptor.rb:6 [FINISH]
c:0046 p:---- s:0263 e:000262 CFUNC  :require
c:0045 p:0030 s:0258 e:000257 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0044 p:0158 s:0252 e:000251 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0043 p:0017 s:0242 e:000241 TOP    /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/encrypted_file.rb:5 [FINISH]
c:0042 p:---- s:0239 e:000238 CFUNC  :require
c:0041 p:0030 s:0234 e:000233 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0040 p:0158 s:0228 e:000227 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0039 p:0011 s:0218 e:000217 TOP    /usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/encrypted_configuration.rb:4 [FINISH]
c:0038 p:---- s:0215 e:000214 CFUNC  :require
c:0037 p:0030 s:0210 e:000209 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0036 p:0158 s:0204 e:000203 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0035 p:0041 s:0194 e:000193 TOP    /usr/local/bundle/gems/railties-7.1.2/lib/rails/application.rb:9 [FINISH]
c:0034 p:---- s:0191 e:000190 CFUNC  :require
c:0033 p:0030 s:0186 e:000185 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0032 p:0158 s:0180 e:000179 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0031 p:0059 s:0170 e:000169 TOP    /usr/local/bundle/gems/railties-7.1.2/lib/rails.rb:15 [FINISH]
c:0030 p:---- s:0167 e:000166 CFUNC  :require
c:0029 p:0030 s:0162 e:000161 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0028 p:0158 s:0156 e:000155 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0027 p:0005 s:0146 e:000145 TOP    /usr/local/bundle/gems/railties-7.1.2/lib/rails/all.rb:5 [FINISH]
c:0026 p:---- s:0143 e:000142 CFUNC  :require
c:0025 p:0030 s:0138 e:000137 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0024 p:0158 s:0132 e:000131 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0023 p:0011 s:0122 e:000121 TOP    /app/config/application.rb:3 [FINISH]
c:0022 p:---- s:0119 e:000118 CFUNC  :require_relative
c:0021 p:0005 s:0114 e:000113 TOP    /app/rakefile:4 [FINISH]
c:0020 p:---- s:0111 e:000110 CFUNC  :load
c:0019 p:0005 s:0106 e:000105 METHOD /usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_module.rb:29
c:0018 p:0143 s:0101 e:000100 METHOD /usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:734
c:0017 p:0003 s:0095 e:000094 BLOCK  /usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:126
c:0016 p:0002 s:0092 e:000091 METHOD /usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:208
c:0015 p:0004 s:0087 e:000086 METHOD /usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:125
c:0014 p:0021 s:0083 e:000082 BLOCK  /usr/local/bundle/gems/railties-7.1.2/lib/rails/commands/rake/rake_command.rb:43
c:0013 p:0023 s:0079 e:000078 METHOD /usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_module.rb:59
c:0012 p:0021 s:0073 e:000072 METHOD /usr/local/bundle/gems/railties-7.1.2/lib/rails/commands/rake/rake_command.rb:41
c:0011 p:0010 s:0066 e:000065 METHOD /usr/local/bundle/gems/railties-7.1.2/lib/rails/commands/rake/rake_command.rb:20
c:0010 p:0032 s:0059 e:000058 METHOD /usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:156
c:0009 p:0035 s:0052 e:000051 BLOCK  /usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:73
c:0008 p:0015 s:0049 e:000048 METHOD /usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:149
c:0007 p:0048 s:0043 e:000042 METHOD /usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:69
c:0006 p:0038 s:0032 e:000031 TOP    /usr/local/bundle/gems/railties-7.1.2/lib/rails/commands.rb:18 [FINISH]
c:0005 p:---- s:0027 e:000026 CFUNC  :require
c:0004 p:0030 s:0022 e:000021 BLOCK  /usr/local/lib/ruby/3.3.0/bundled_gems.rb:74
c:0003 p:0158 s:0016 e:000015 METHOD /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32
c:0002 p:0024 s:0006 e:000005 EVAL   bin/rails:4 [FINISH]
c:0001 p:0000 s:0003 E:0019e0 DUMMY  [FINISH]

-- Ruby level backtrace information ----------------------------------------
bin/rails:4:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/commands.rb:18:in `<main>'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:69:in `invoke'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:149:in `with_argv'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:73:in `block in invoke'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/command.rb:156:in `invoke_rake'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_module.rb:59:in `with_application'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/commands/rake/rake_command.rb:43:in `block in with_rake'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:125:in `load_rakefile'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:208:in `standard_exception_handling'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:126:in `block in load_rakefile'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:734:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_module.rb:29:in `load_rakefile'
/usr/local/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_module.rb:29:in `load'
/app/rakefile:4:in `<main>'
/app/rakefile:4:in `require_relative'
/app/config/application.rb:3:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/all.rb:5:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/railties-7.1.2/lib/rails.rb:15:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/railties-7.1.2/lib/rails/application.rb:9:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/encrypted_configuration.rb:4:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/encrypted_file.rb:5:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/message_encryptor.rb:6:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/messages/codec.rb:4:in `<main>'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/messages/codec.rb:4:in `require_relative'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/messages/metadata.rb:4:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/json.rb:4:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/json/encoding.rb:3:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/core_ext/object/json.rb:14:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/core_ext/time/conversions.rb:5:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/activesupport-7.1.2/lib/active_support/values/time_zone.rb:3:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/tzinfo-2.0.6/lib/tzinfo.rb:25:in `<main>'
/usr/local/bundle/gems/tzinfo-2.0.6/lib/tzinfo.rb:25:in `require_relative'
/usr/local/bundle/gems/tzinfo-2.0.6/lib/tzinfo/string_deduper.rb:4:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent.rb:6:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomics.rb:8:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.rb:7:in `<main>'
/usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/usr/local/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:5:in `<main>'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:18:in `<module:Concurrent>'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:12:in `mutex_owned_per_thread?'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:12:in `synchronize'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:14:in `block in mutex_owned_per_thread?'
/usr/local/bundle/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:14:in `resume'

-- Threading information ---------------------------------------------------
Total ractor count: 1
Ruby thread count for this ractor: 1

-- Machine register context ------------------------------------------------
  x0: 0x0000aaab0b56eb50  x1: 0x0000aaab0c897b80  x2: 0x0000ffffc56732b0
  x3: 0x0000ffff7ab2ff60  x4: 0x0000ffff7ab30018  x5: 0x0000ffff7ab50000
  x6: 0x0000ffff9537db88  x7: 0x0000000000000000 x18: 0x000000000000744b
 x19: 0x0000000000000000 x20: 0x0000000000000000 x21: 0x0000000000000000
 x22: 0x0000000000000000 x23: 0x0000000000000000 x24: 0x0000000000000000
 x25: 0x0000000000000000 x26: 0x0000000000000000 x27: 0x0000000000000000
 x28: 0x0000000000000000 x29: 0x0000000000000000  sp: 0x0000ffff7ab30000
 fau: 0x0057ffff94e306c0

-- C level backtrace information -------------------------------------------

As far as I investigated with rdbg, the SEGV emits at Fiber.new { mutex.owned? }.resume in lock_local_var.rb:

Seems like the mutex has been missed.

How to reproduce

I prepared a repository for reproducing the issue: https://github.com/hachi8833/rails712_ruby33

  1. Prepare Docker Desktop for Mac on M1 Macbook
  2. Install dip tool via gem install dip
  3. Clone rails712_ruby33 to your local dir.
  4. dip build
  5. dip bundle install
  6. dip rails about(or any other rails commands), which emits the SEGV

Additional info

I created the repo first with Ruby 3.2.2, and then upgraded to Ruby 3.3.0 because it is impossible to run even rails new in that Ruby 3.3.0 + Rails 7.2.1 + Docker.

The Dockerfile I'm using is not the one that generated by Rails for production env, but for development.
ref: Ruby on Whales: Dockerizing Ruby and Rails development—Martian Chronicles, Evil Martians’ team blog

I'm unsure if the issue affects other PC environments such as Windows or Linux.

@MrJoy
Copy link

MrJoy commented Dec 27, 2023

I'm seeing the same issue, and can add a bit of extra detail: All that needs to happen to trigger the exception is require 'concurrent-ruby'.

I.E. if I use docker-compose run rails /bin/sh to get into a bash shell, then bin/pry to start Pry, I can trigger the error with require 'concurrent-ruby' -- without loading the full Rails stack.

@MrJoy
Copy link

MrJoy commented Dec 27, 2023

See also: https://bugs.ruby-lang.org/issues/20085

@hachi8833
Copy link
Author

Thank you for the info! I should close the issue when the issue you specified is resolved ❤️

@eregon
Copy link
Collaborator

eregon commented Dec 27, 2023

Segfaults are CRuby bugs (https://bugs.ruby-lang.org/issues/20085), not a concurrent-ruby issue, so I close this.
I'll add 3.3 to the CI though.

@hachi8833
Copy link
Author

Thnx! I should've closed this issue by myself 🙏

ChrisBAshton added a commit to alphagov/feedback that referenced this issue Mar 21, 2024
Ruby 3.3.0 produces segfaults in Docker on Macs in
concurrent-ruby:
ruby-concurrency/concurrent-ruby#1020 https://bugs.ruby-lang.org/issues/20085

concurrent-ruby is a transient dependency of feedback.
ChrisBAshton added a commit to alphagov/feedback that referenced this issue Mar 22, 2024
Ruby 3.3.0 produces segfaults in Docker on Macs in
concurrent-ruby:
ruby-concurrency/concurrent-ruby#1020 https://bugs.ruby-lang.org/issues/20085

concurrent-ruby is a transient dependency of feedback.
ChrisBAshton added a commit to alphagov/feedback that referenced this issue Mar 25, 2024
Ruby 3.3.0 produces segfaults in Docker on Macs in
concurrent-ruby:
ruby-concurrency/concurrent-ruby#1020 https://bugs.ruby-lang.org/issues/20085

concurrent-ruby is a transient dependency of feedback.
ChrisBAshton added a commit to alphagov/feedback that referenced this issue Mar 25, 2024
Ruby 3.3.0 produces segfaults in Docker on Macs in
concurrent-ruby:
ruby-concurrency/concurrent-ruby#1020 https://bugs.ruby-lang.org/issues/20085

concurrent-ruby is a transient dependency of feedback.
ChrisBAshton added a commit to alphagov/feedback that referenced this issue Mar 25, 2024
Ruby 3.3.0 produces segfaults in Docker on Macs in
concurrent-ruby:
ruby-concurrency/concurrent-ruby#1020 https://bugs.ruby-lang.org/issues/20085

concurrent-ruby is a transient dependency of feedback.
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

3 participants