Project

General

Profile

Actions

Bug #20426

closed

crash on aarch64 linux when using fibers (regression with 3.3)

Added by froydnj (Nathan Froyd) 7 months ago. Updated 7 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [aarch64-linux]
[ruby-core:117503]

Description

We are seeing crashes when using Ruby 3.3 on aarch64-linux and the concurrent-ruby gem. We reduced the crashing testcase to:

Fiber.new {}.resume

which crashes on 3.3.0:

🍖 froydnj@froydnj-arm64-devbox(graviton):~/ruby-3.3.0$ ~/ruby-3-release/bin/ruby -v
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [aarch64-linux]
🍖 froydnj@froydnj-arm64-devbox(graviton):~/ruby-3.3.0$ ~/ruby-3-release/bin/ruby -e 'Fiber.new {}.resume'
-e:1: [BUG] Segmentation fault at 0x000baaaac8a27e30
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [aarch64-linux]

-- Control frame information -----------------------------------------------
c:0003 p:---- s:0010 e:000009 CFUNC  :resume
c:0002 p:0007 s:0006 E:0009f0 EVAL   -e:1 [FINISH]
c:0001 p:0000 s:0003 E:0021b0 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: 0x0000aaaae077e910  x1: 0x0000aaaae08a8110  x2: 0x0000ffffd5d49ff0
  x3: 0x0000ffff72bdef60  x4: 0x0000000000000004  x5: 0x0000ffff72bdf018
  x6: 0x0000ffff72b5e000  x7: 0x0000ffff72bff000 x18: 0x0000000000000000
 x19: 0x0000000000000000 x20: 0x0000000000000000 x21: 0x0000000000000000
 x22: 0x0000000000000000 x23: 0x0000000000000000 x24: 0x0000000000000000
 x25: 0x0000000000000000 x26: 0x0000000000000000 x27: 0x0000000000000000
 x28: 0x0000000000000000 x29: 0x0000000000000000  sp: 0x0000ffff72bdf000
 fau: 0x000baaaac8a27e30

-- C level backtrace information -------------------------------------------
Segmentation fault (core dumped)

We bisected to this commit, landed shortly before the release:

https://github.com/ruby/ruby/commit/d9e5564ccd0e460b7685b786d21cf386b229e2a9

The parent revision:

https://github.com/ruby/ruby/commit/9a3c49ee5d6dd3770c21ed8193e7efd64cd81a6e

has no problems.

Example output:

🍖 froydnj@froydnj-arm64-devbox(graviton):~/ruby$ ~/ruby-3-ok/bin/ruby -e 'Fiber.new {}.resume'
🍖 froydnj@froydnj-arm64-devbox(graviton):~/ruby$ echo $?
0
🍖 froydnj@froydnj-arm64-devbox(graviton):~/ruby$ ~/ruby-3-ok/bin/ruby -v
ruby 3.3.0dev (2023-12-22T01:47:36Z v3_3_0~76 9a3c49ee5d) [aarch64-linux]
🍖 froydnj@froydnj-arm64-devbox(graviton):~/ruby$ ~/ruby-3-ko/bin/ruby -e 'Fiber.new {}.resume'
-e:1: [BUG] Segmentation fault at 0x0026aaaadfeb5698
ruby 3.3.0dev (2023-12-22T02:30:00Z v3_3_0~75 d9e5564ccd) [aarch64-linux]

-- Control frame information -----------------------------------------------
c:0003 p:---- s:0010 e:000009 CFUNC  :resume
c:0002 p:0007 s:0006 E:0023c0 EVAL   -e:1 [FINISH]
c:0001 p:0000 s:0003 E:0004d0 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: 0x0000aaaaefe05910  x1: 0x0000aaaaf00229b0  x2: 0x0000ffffe91efc00
  x3: 0x0000ffff6a9fef50  x4: 0x0000000000000004  x5: 0x0000ffff6a9ff018
  x6: 0x0000ffff6a97e000  x7: 0x0000ffff6aa1f000 x18: 0x0000000000000000
 x19: 0x0000000000000000 x20: 0x0000000000000000 x21: 0x0000000000000000
 x22: 0x0000000000000000 x23: 0x0000000000000000 x24: 0x0000000000000000
 x25: 0x0000000000000000 x26: 0x0000000000000000 x27: 0x0000000000000000
 x28: 0x0000000000000000 x29: 0x0000000000000000  sp: 0x0000ffff6a9ff000
 fau: 0x0026aaaadfeb5698

-- C level backtrace information -------------------------------------------
Segmentation fault (core dumped)
🍖 froydnj@froydnj-arm64-devbox(graviton):~/ruby$ ~/ruby-3-ko/bin/ruby -v
ruby 3.3.0dev (2023-12-22T02:30:00Z v3_3_0~75 d9e5564ccd) [aarch64-linux]

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 ufuk (Ufuk Kayserilioglu) 7 months ago

I believe this is the same issue as https://bugs.ruby-lang.org/issues/20085 which is fixed and back-ported, waiting for a release of 3.3.1.

Actions #2

Updated by hsbt (Hiroshi SHIBATA) 7 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) 7 months ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like1Like0Like0