Project

General

Profile

Actions

Bug #20268

closed

Segfault in ruby 3.3 Fiber on aarch64 musl (mac m1)

Added by vasfed (Vasily Fedoseyev) 11 months ago. Updated 9 months ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:116781]
Tags:

Description

On mac m1pro the following

docker run --platform linux/aarch64 --rm -it ruby:3.3.0-alpine3.19 ruby -e 'Fiber.new { puts 123 }.resume'

produces segfault:

-e:1: [BUG] Segmentation fault at 0x006cffff93eecfd0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [aarch64-linux-musl]

-- Control frame information -----------------------------------------------
c:0003 p:---- s:0010 e:000009 CFUNC  :resume
c:0002 p:0007 s:0006 E:000260 EVAL   -e:1 [FINISH]
c:0001 p:0000 s:0003 E:000b40 DUMMY  [FINISH]

-- Ruby level backtrace information ----------------------------------------
-e:1:in `<main>'
-e:1:in `resume'

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

-- Machine register context ------------------------------------------------
  x0: 0x0000ffff943ed9a0  x1: 0x0000ffff7911af30  x2: 0x0000ffffec47f610
  x3: 0x0000ffff7a67df60  x4: 0x0000ffff7a67e018  x5: 0x0000ffff7a69e000
  x6: 0x0000ffff944afff0  x7: 0x0000000000000000 x18: 0x0000ffff78ef0290
 x19: 0x0000000000000000 x20: 0x0000000000000000 x21: 0x0000000000000000
 x22: 0x0000000000000000 x23: 0x0000000000000000 x24: 0x0000000000000000
 x25: 0x0000000000000000 x26: 0x0000000000000000 x27: 0x0000000000000000
 x28: 0x0000000000000000 x29: 0x0000000000000000  sp: 0x0000ffff7a67e000
 fau: 0x006cffff93eecfd0

-- Other runtime information -----------------------------------------------

* Loaded script: -e

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 fiber.so
    3 rational.so
    4 complex.so
    5 ruby2_keywords.rb
    6 /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/enc/encdb.so
    7 /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/enc/trans/transdb.so
    8 /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/rbconfig.rb
    9 /usr/local/lib/ruby/3.3.0/rubygems/compatibility.rb
   10 /usr/local/lib/ruby/3.3.0/rubygems/defaults.rb
   11 /usr/local/lib/ruby/3.3.0/rubygems/deprecate.rb
   12 /usr/local/lib/ruby/3.3.0/rubygems/errors.rb
   13 /usr/local/lib/ruby/3.3.0/rubygems/unknown_command_spell_checker.rb
   14 /usr/local/lib/ruby/3.3.0/rubygems/exceptions.rb
   15 /usr/local/lib/ruby/3.3.0/rubygems/basic_specification.rb
   16 /usr/local/lib/ruby/3.3.0/rubygems/stub_specification.rb
   17 /usr/local/lib/ruby/3.3.0/rubygems/platform.rb
   18 /usr/local/lib/ruby/3.3.0/rubygems/util/list.rb
   19 /usr/local/lib/ruby/3.3.0/rubygems/version.rb
   20 /usr/local/lib/ruby/3.3.0/rubygems/requirement.rb
   21 /usr/local/lib/ruby/3.3.0/rubygems/specification.rb
   22 /usr/local/lib/ruby/3.3.0/rubygems/util.rb
   23 /usr/local/lib/ruby/3.3.0/rubygems/dependency.rb
   24 /usr/local/lib/ruby/3.3.0/rubygems/core_ext/kernel_gem.rb
   25 /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/monitor.so
   26 /usr/local/lib/ruby/3.3.0/monitor.rb
   27 /usr/local/lib/ruby/3.3.0/rubygems.rb
   28 /usr/local/lib/ruby/3.3.0/bundled_gems.rb
   29 /usr/local/lib/ruby/3.3.0/rubygems/path_support.rb
   30 /usr/local/lib/ruby/3.3.0/error_highlight/version.rb
   31 /usr/local/lib/ruby/3.3.0/error_highlight/base.rb
   32 /usr/local/lib/ruby/3.3.0/error_highlight/formatter.rb
   33 /usr/local/lib/ruby/3.3.0/error_highlight/core_ext.rb
   34 /usr/local/lib/ruby/3.3.0/error_highlight.rb
   35 /usr/local/lib/ruby/3.3.0/did_you_mean/version.rb
   36 /usr/local/lib/ruby/3.3.0/did_you_mean/core_ext/name_error.rb
   37 /usr/local/lib/ruby/3.3.0/did_you_mean/levenshtein.rb
   38 /usr/local/lib/ruby/3.3.0/did_you_mean/jaro_winkler.rb
   39 /usr/local/lib/ruby/3.3.0/did_you_mean/spell_checker.rb
   40 /usr/local/lib/ruby/3.3.0/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb
   41 /usr/local/lib/ruby/3.3.0/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb
   42 /usr/local/lib/ruby/3.3.0/did_you_mean/spell_checkers/name_error_checkers.rb
   43 /usr/local/lib/ruby/3.3.0/did_you_mean/spell_checkers/method_name_checker.rb
   44 /usr/local/lib/ruby/3.3.0/did_you_mean/spell_checkers/key_error_checker.rb
   45 /usr/local/lib/ruby/3.3.0/did_you_mean/spell_checkers/null_checker.rb
   46 /usr/local/lib/ruby/3.3.0/did_you_mean/tree_spell_checker.rb
   47 /usr/local/lib/ruby/3.3.0/did_you_mean/spell_checkers/require_path_checker.rb
   48 /usr/local/lib/ruby/3.3.0/did_you_mean/spell_checkers/pattern_key_name_checker.rb
   49 /usr/local/lib/ruby/3.3.0/did_you_mean/formatter.rb
   50 /usr/local/lib/ruby/3.3.0/did_you_mean.rb
   51 /usr/local/lib/ruby/3.3.0/syntax_suggest/core_ext.rb

* Process memory map:

aaaac56e0000-aaaac56e1000 r-xp 00000000 fe:01 3134602                    /usr/local/bin/ruby
aaaac56ff000-aaaac5700000 r--p 0000f000 fe:01 3134602                    /usr/local/bin/ruby
aaaac5700000-aaaac5701000 rw-p 00010000 fe:01 3134602                    /usr/local/bin/ruby
aaaacdc11000-aaaacdc12000 ---p 00000000 00:00 0                          [heap]
aaaacdc12000-aaaacdc1d000 rw-p 00000000 00:00 0                          [heap]
ffff78bcd000-ffff78bdd000 rw-p 00000000 00:00 0
ffff78e10000-ffff78e45000 rw-p 00000000 00:00 0
ffff78e51000-ffff78e82000 rw-p 00000000 00:00 0
ffff78e82000-ffff78ea1000 r-xp 00000000 fe:01 3134882                    /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/monitor.so
ffff78ea1000-ffff78ea2000 r--p 0000f000 fe:01 3134882                    /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/monitor.so
ffff78ea2000-ffff78ea3000 rw-p 00010000 fe:01 3134882                    /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/monitor.so
ffff78ea3000-ffff78f00000 rw-p 00000000 00:00 0
ffff78f07000-ffff78f76000 rw-p 00000000 00:00 0
ffff78f77000-ffff78f7f000 rw-p 00000000 00:00 0
ffff78f8c000-ffff78fa8000 rw-p 00000000 00:00 0
ffff78faa000-ffff78fac000 rw-p 00000000 00:00 0
ffff78faf000-ffff78fc2000 rw-p 00000000 00:00 0
ffff78fc3000-ffff790c5000 rw-p 00000000 00:00 0
ffff790c9000-ffff79185000 rw-p 00000000 00:00 0
ffff79187000-ffff79189000 rw-p 00000000 00:00 0
ffff7918b000-ffff79191000 rw-p 00000000 00:00 0
ffff79198000-ffff791ff000 rw-p 00000000 00:00 0
ffff791ff000-ffff7921e000 r-xp 00000000 fe:01 3134859                    /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/enc/trans/transdb.so
ffff7921e000-ffff7921f000 r--p 0000f000 fe:01 3134859                    /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/enc/trans/transdb.so
ffff7921f000-ffff79220000 rw-p 00010000 fe:01 3134859                    /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/enc/trans/transdb.so
ffff79220000-ffff7923d000 rw-p 00000000 00:00 0
ffff7923d000-ffff7925c000 r-xp 00000000 fe:01 3134816                    /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/enc/encdb.so
ffff7925c000-ffff7925d000 r--p 0000f000 fe:01 3134816                    /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/enc/encdb.so
ffff7925d000-ffff7925e000 rw-p 00010000 fe:01 3134816                    /usr/local/lib/ruby/3.3.0/aarch64-linux-musl/enc/encdb.so
ffff7925e000-ffff7925f000 ---p 00000000 00:00 0
ffff7925f000-ffff79300000 rw-p 00000000 00:00 0
ffff79300000-ffff79301000 ---p 00000000 00:00 0
ffff79301000-ffff793a2000 rw-p 00000000 00:00 0
ffff793a2000-ffff793a3000 ---p 00000000 00:00 0
ffff793a3000-ffff79444000 rw-p 00000000 00:00 0
ffff79444000-ffff79445000 ---p 00000000 00:00 0
ffff79445000-ffff794e6000 rw-p 00000000 00:00 0
ffff794e6000-ffff794e7000 ---p 00000000 00:00 0
ffff794e7000-ffff79588000 rw-p 00000000 00:00 0
ffff79588000-ffff79589000 ---p 00000000 00:00 0
ffff79589000-ffff7962a000 rw-p 00000000 00:00 0
ffff7962a000-ffff7962b000 ---p 00000000 00:00 0
ffff7962b000-ffff796cc000 rw-p 00000000 00:00 0
ffff796cc000-ffff796cd000 ---p 00000000 00:00 0
ffff796cd000-ffff7976e000 rw-p 00000000 00:00 0
ffff7976e000-ffff7976f000 ---p 00000000 00:00 0
ffff7976f000-ffff79810000 rw-p 00000000 00:00 0
ffff79810000-ffff79811000 ---p 00000000 00:00 0
ffff79811000-ffff798b2000 rw-p 00000000 00:00 0
ffff798b2000-ffff798b3000 ---p 00000000 00:00 0
ffff798b3000-ffff79954000 rw-p 00000000 00:00 0
ffff79954000-ffff79955000 ---p 00000000 00:00 0
ffff79955000-ffff799f6000 rw-p 00000000 00:00 0
ffff799f6000-ffff799f7000 ---p 00000000 00:00 0
ffff799f7000-ffff79a98000 rw-p 00000000 00:00 0
ffff79a98000-ffff79a99000 ---p 00000000 00:00 0
ffff79a99000-ffff79b3a000 rw-p 00000000 00:00 0
ffff79b3a000-ffff79b3b000 ---p 00000000 00:00 0
ffff79b3b000-ffff79bdc000 rw-p 00000000 00:00 0
ffff79bdc000-ffff79bdd000 ---p 00000000 00:00 0
ffff79bdd000-ffff79c7e000 rw-p 00000000 00:00 0
ffff79c7e000-ffff79c7f000 ---p 00000000 00:00 0
ffff79c7f000-ffff79d20000 rw-p 00000000 00:00 0
ffff79d20000-ffff79d21000 ---p 00000000 00:00 0
ffff79d21000-ffff79dc2000 rw-p 00000000 00:00 0
ffff79dc2000-ffff79dc3000 ---p 00000000 00:00 0
ffff79dc3000-ffff79e64000 rw-p 00000000 00:00 0
ffff79e64000-ffff79e65000 ---p 00000000 00:00 0
ffff79e65000-ffff79f06000 rw-p 00000000 00:00 0
ffff79f06000-ffff79f07000 ---p 00000000 00:00 0
ffff79f07000-ffff79fa8000 rw-p 00000000 00:00 0
ffff79fa8000-ffff79fa9000 ---p 00000000 00:00 0
ffff79fa9000-ffff7a04a000 rw-p 00000000 00:00 0
ffff7a04a000-ffff7a04b000 ---p 00000000 00:00 0
ffff7a04b000-ffff7a0ec000 rw-p 00000000 00:00 0
ffff7a0ec000-ffff7a0ed000 ---p 00000000 00:00 0
ffff7a0ed000-ffff7a18e000 rw-p 00000000 00:00 0
ffff7a18e000-ffff7a18f000 ---p 00000000 00:00 0
ffff7a18f000-ffff7a230000 rw-p 00000000 00:00 0
ffff7a230000-ffff7a231000 ---p 00000000 00:00 0
ffff7a231000-ffff7a2d2000 rw-p 00000000 00:00 0
ffff7a2d2000-ffff7a2d3000 ---p 00000000 00:00 0
ffff7a2d3000-ffff7a374000 rw-p 00000000 00:00 0
ffff7a374000-ffff7a375000 ---p 00000000 00:00 0
ffff7a375000-ffff7a416000 rw-p 00000000 00:00 0
ffff7a416000-ffff7a417000 ---p 00000000 00:00 0
ffff7a417000-ffff7a4b8000 rw-p 00000000 00:00 0
ffff7a4b8000-ffff7a4b9000 ---p 00000000 00:00 0
ffff7a4b9000-ffff7a55a000 rw-p 00000000 00:00 0
ffff7a55a000-ffff7a55b000 ---p 00000000 00:00 0
ffff7a55b000-ffff7a5fc000 rw-p 00000000 00:00 0
ffff7a5fc000-ffff7a5fd000 ---p 00000000 00:00 0
ffff7a5fd000-ffff7a6b2000 rw-p 00000000 00:00 0
ffff7a6b2000-ffff7a6b4000 ---p 00000000 00:00 0
ffff7a6b4000-ffff93d27000 rw-p 00000000 00:00 0
ffff93d27000-ffff93d56000 r-xp 00000000 fe:01 3134315                    /usr/lib/libgcc_s.so.1
ffff93d56000-ffff93d57000 r--p 0001f000 fe:01 3134315                    /usr/lib/libgcc_s.so.1
ffff93d57000-ffff93d58000 rw-p 00020000 fe:01 3134315                    /usr/lib/libgcc_s.so.1
ffff93d58000-ffff93dd6000 r-xp 00000000 fe:01 3134319                    /usr/lib/libgmp.so.10.5.0
ffff93dd6000-ffff93dd8000 r--p 0006e000 fe:01 3134319                    /usr/lib/libgmp.so.10.5.0
ffff93dd8000-ffff93dd9000 rw-p 00070000 fe:01 3134319                    /usr/lib/libgmp.so.10.5.0
ffff93dd9000-ffff93e08000 r-xp 00000000 fe:01 49695                      /lib/libz.so.1.3.1
ffff93e08000-ffff93e09000 r--p 0001f000 fe:01 49695                      /lib/libz.so.1.3.1
ffff93e09000-ffff93e0a000 rw-p 00020000 fe:01 49695                      /lib/libz.so.1.3.1
ffff93e0a000-ffff943c1000 r-xp 00000000 fe:01 3134798                    /usr/local/lib/libruby.so.3.3.0
ffff943c1000-ffff943da000 r--p 005b7000 fe:01 3134798                    /usr/local/lib/libruby.so.3.3.0
ffff943da000-ffff943db000 rw-p 005d0000 fe:01 3134798                    /usr/local/lib/libruby.so.3.3.0
ffff943db000-ffff943ee000 rw-p 00000000 00:00 0
ffff943ee000-ffff94490000 r-xp 00000000 fe:01 49689                      /lib/ld-musl-aarch64.so.1
ffff94490000-ffff944aa000 rw-p 00000000 00:00 0
ffff944aa000-ffff944ac000 r--p 00000000 00:00 0                          [vvar]
ffff944ac000-ffff944ad000 r-xp 00000000 00:00 0                          [vdso]
ffff944ad000-ffff944af000 rw-p 000af000 fe:01 49689                      /lib/ld-musl-aarch64.so.1
ffff944af000-ffff944b1000 rw-p 00000000 00:00 0
ffffebc82000-ffffec481000 rw-p 00000000 00:00 0                          [stack]

This only occurs for 3.3 on aarch64 platform (same for alpine3.18),
docker run --platform linux/amd64 --rm -it ruby:3.3.0-alpine3.19 ruby -e 'Fiber.new { puts 123 }.resume' and aarch64 ruby:3.2.3-alpine3.19 on the same machine works correctly.


Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #20085: Fiber.new{ }.resume causes Segmentation fault for Ruby 3.3.0 on aarch64-linuxClosedkatei (Yuta Saito)Actions

Updated by alanwu (Alan Wu) 11 months ago

  • Status changed from Open to Closed

This is a duplicate of #20085. The fix should come out with the next release.

Actions #2

Updated by alanwu (Alan Wu) 11 months ago

  • Is duplicate of Bug #20085: Fiber.new{ }.resume causes Segmentation fault for Ruby 3.3.0 on aarch64-linux added
Actions #3

Updated by hsbt (Hiroshi SHIBATA) 9 months ago

  • Tags set to musl, alpine
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0