Skip to content

Segfault in lock_local_var.rb on aarch64 #1022

@RemcodM

Description

@RemcodM
* Operating system:                linux
* Ruby implementation:             Ruby
* `concurrent-ruby` version:       1.2.2
* `concurrent-ruby-ext` installed: no
* `concurrent-ruby-edge` used:     no

When using Ruby 3.3 on Linux aarch64, booting up applications like puma or bootsnap crashes with a segfault in lock_local_var.rb.

/home/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:14: [BUG] Segmentation fault at 0x0051ffff841106c0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [aarch64-linux]

-- Control frame information -----------------------------------------------
c:0074 p:---- s:0372 e:000371 CFUNC  :resume
c:0073 p:0007 s:0368 E:000e70 BLOCK  /home/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:14 [FINISH]
c:0072 p:---- s:0365 e:000364 CFUNC  :synchronize
c:0071 p:0026 s:0361 E:0003d8 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:12
c:0070 p:0007 s:0356 e:000355 CLASS  /home/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:18
c:0069 p:0025 s:0353 e:000352 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb:5 [FINISH]
c:0068 p:---- s:0350 e:000349 CFUNC  :require
c:0067 p:0011 s:0345 e:000344 METHOD <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37
c:0066 p:0041 s:0339 e:000338 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomic/reentrant_read_write_lock.r [FINISH]
c:0065 p:---- s:0336 e:000335 CFUNC  :require
c:0064 p:0011 s:0331 e:000330 METHOD <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37
c:0063 p:0047 s:0325 e:000324 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/atomics.rb:8 [FINISH]
c:0062 p:---- s:0322 e:000321 CFUNC  :require
c:0061 p:0011 s:0317 e:000316 METHOD <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37
c:0060 p:0029 s:0311 e:000310 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent.rb:6 [FINISH]
c:0059 p:---- s:0308 e:000307 CFUNC  :require
c:0058 p:0011 s:0303 e:000302 METHOD <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37
c:0057 p:0005 s:0297 e:000296 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/string_deduper.rb:4 [FINISH]
c:0056 p:---- s:0294 e:000293 CFUNC  :require_relative
c:0055 p:0025 s:0289 e:000288 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo.rb:25 [FINISH]
c:0054 p:---- s:0286 e:000285 CFUNC  :require
c:0053 p:0011 s:0281 e:000280 METHOD <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37
c:0052 p:0005 s:0275 e:000274 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.2/lib/active_support/values/time_zone.rb:3 [FINISH]
c:0051 p:---- s:0272 e:000271 CFUNC  :require
c:0050 p:0011 s:0267 e:000266 METHOD <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37
c:0049 p:0017 s:0261 e:000260 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.2/lib/active_support/time_with_zone.rb:6 [FINISH]
c:0048 p:---- s:0258 e:000257 CFUNC  :require
c:0047 p:0011 s:0253 e:000252 METHOD <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37
c:0046 p:0005 s:0247 e:000246 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.2/lib/active_support/core_ext/time/zones.rb:3 [FINISH]
c:0045 p:---- s:0244 e:000243 CFUNC  :require
c:0044 p:0011 s:0239 e:000238 METHOD <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37
c:0043 p:0029 s:0233 e:000232 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.2/lib/active_support/core_ext/date/calculations.rb:7 [FINISH]
c:0042 p:---- s:0230 e:000229 CFUNC  :require
c:0041 p:0011 s:0225 e:000224 METHOD <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37
c:0040 p:0017 s:0219 e:000218 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.2/lib/active_support/core_ext/date.rb:5 [FINISH]
c:0039 p:---- s:0216 e:000215 CFUNC  :require
c:0038 p:0011 s:0211 e:000210 METHOD <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37
c:0037 p:0016 s:0205 e:000204 BLOCK  /home/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.2/lib/active_support/core_ext.rb:5 [FINISH]
c:0036 p:---- s:0201 e:000200 CFUNC  :each
c:0035 p:0018 s:0197 e:000196 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.2/lib/active_support/core_ext.rb:3 [FINISH]
c:0034 p:---- s:0194 e:000193 CFUNC  :require
c:0033 p:0011 s:0189 e:000188 METHOD <internal:/usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37
c:0032 p:0017 s:0183 e:000182 TOP    /home/app/app/sandbox.rb:5 [FINISH]
c:0031 p:---- s:0180 e:000179 CFUNC  :require_relative
c:0030 p:0005 s:0175 e:000174 EVAL   config.ru:3 [FINISH]
c:0029 p:---- s:0172 e:000171 CFUNC  :eval
c:0028 p:0026 s:0165 e:000164 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/rack-2.2.8/lib/rack/builder.rb:116
c:0027 p:0091 s:0157 e:000156 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/rack-2.2.8/lib/rack/builder.rb:105
c:0026 p:0021 s:0148 e:000147 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/rack-2.2.8/lib/rack/builder.rb:66
c:0025 p:0034 s:0141 e:000140 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/puma-6.4.0/lib/puma/configuration.rb:368
c:0024 p:0014 s:0134 e:000133 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/puma-6.4.0/lib/puma/configuration.rb:290
c:0023 p:0023 s:0128 e:000127 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/puma-6.4.0/lib/puma/runner.rb:162
c:0022 p:0009 s:0123 e:000122 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/puma-6.4.0/lib/puma/single.rb:44
c:0021 p:0033 s:0117 e:000116 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/puma-6.4.0/lib/puma/launcher.rb:194
c:0020 p:0005 s:0112 e:000111 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/puma-6.4.0/lib/puma/cli.rb:75
c:0019 p:0018 s:0108 e:000107 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/puma-6.4.0/bin/puma:10 [FINISH]
c:0018 p:---- s:0104 e:000103 CFUNC  :load
c:0017 p:0078 s:0099 e:000098 TOP    /home/app/vendor/bundle/ruby/3.3.0/bin/puma:25 [FINISH]
c:0016 p:---- s:0094 e:000093 CFUNC  :load
c:0015 p:0064 s:0089 e:000088 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/bundler-2.4.12/lib/bundler/cli/exec.rb:58
c:0014 p:0050 s:0083 e:000082 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/bundler-2.4.12/lib/bundler/cli/exec.rb:23
c:0013 p:0034 s:0078 e:000077 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/bundler-2.4.12/lib/bundler/cli.rb:492
c:0012 p:0054 s:0073 e:000072 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/bundler-2.4.12/lib/bundler/vendor/thor/lib/thor/command.rb:27
c:0011 p:0040 s:0065 e:000064 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/bundler-2.4.12/lib/bundler/vendor/thor/lib/thor/invocation.rb:127
c:0010 p:0213 s:0058 e:000057 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/bundler-2.4.12/lib/bundler/vendor/thor/lib/thor.rb:392
c:0009 p:0008 s:0045 e:000044 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/bundler-2.4.12/lib/bundler/cli.rb:34
c:0008 p:0044 s:0040 e:000039 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/bundler-2.4.12/lib/bundler/vendor/thor/lib/thor/base.rb:485
c:0007 p:0022 s:0033 e:000032 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/bundler-2.4.12/lib/bundler/cli.rb:28
c:0006 p:0058 s:0028 e:000027 BLOCK  /home/app/vendor/bundle/ruby/3.3.0/gems/bundler-2.4.12/exe/bundle:45
c:0005 p:0007 s:0022 e:000021 METHOD /home/app/vendor/bundle/ruby/3.3.0/gems/bundler-2.4.12/lib/bundler/friendly_errors.rb:117
c:0004 p:0125 s:0017 E:0010b8 TOP    /home/app/vendor/bundle/ruby/3.3.0/gems/bundler-2.4.12/exe/bundle:33 [FINISH]
c:0003 p:---- s:0013 e:000012 CFUNC  :load
c:0002 p:0081 s:0008 E:000cb0 EVAL   /usr/local/bin/bundle:25 [FINISH]
c:0001 p:0000 s:0003 E:0023a0 DUMMY  [FINISH]

This does not seem to happen on Intel based machines, e.g. x86_64. I couldn't look to much into it yet, so sadly I have no more information available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions