* [ruby-core:121642] [Ruby Bug#21266] YJIT GC safety crash with proc objects as block argument
@ 2025-04-13 13:20 alanwu (Alan Wu) via ruby-core
2025-12-16 23:53 ` [ruby-core:124266] " k0kubun (Takashi Kokubun) via ruby-core
2025-12-19 19:04 ` [ruby-core:124327] " rwstauner (Randy Stauner) via ruby-core
0 siblings, 2 replies; 3+ messages in thread
From: alanwu (Alan Wu) via ruby-core @ 2025-04-13 13:20 UTC (permalink / raw)
To: ruby-core; +Cc: alanwu (Alan Wu)
Issue #21266 has been reported by alanwu (Alan Wu).
----------------------------------------
Bug #21266: YJIT GC safety crash with proc objects as block argument
https://bugs.ruby-lang.org/issues/21266
* Author: alanwu (Alan Wu)
* Status: Open
* Assignee: yjit
* Backport: 3.2: DONTNEED, 3.3: REQUIRED, 3.4: REQUIRED
----------------------------------------
```ruby
# Run with --yjit-call-threshold=1
def foo(args) = bar(*args, &proc { _1 })
def bar(_, _, _, _, *rest) = yield rest
GC.stress = true
foo([1,2,3,4])
foo([1,2,3,4])
```
The proc in these calls get collected on the yield to the GC to allocate the rest parameter arary.
```
../vm_core.h:1668: Assertion Failed: vm_block_handler_type:rb_obj_is_proc(block_handler)
```
Or in release builds:
```
../test.rb:1: [BUG] Segmentation fault at 0x0000000000000020
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) +YJIT [arm64-darwin24]
-- C level backtrace information -------------------------------------------
/Users/alan/.rubies/ruby-3.3.6/bin/ruby(rb_vm_bugreport+0xb4c) [0x104595590]
/Users/alan/.rubies/ruby-3.3.6/bin/ruby(rb_bug_for_fatal_signal+0x100) [0x1043d6120]
/Users/alan/.rubies/ruby-3.3.6/bin/ruby(sig_do_nothing+0x0) [0x1044fc4b0]
/usr/lib/system/libsystem_platform.dylib(_sigtramp+0x38) [0x187572de4]
/Users/alan/.rubies/ruby-3.3.6/bin/ruby(rb_vm_invokeblock+0x144) [0x10456b004]
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ruby-core:124266] [Ruby Bug#21266] YJIT GC safety crash with proc objects as block argument
2025-04-13 13:20 [ruby-core:121642] [Ruby Bug#21266] YJIT GC safety crash with proc objects as block argument alanwu (Alan Wu) via ruby-core
@ 2025-12-16 23:53 ` k0kubun (Takashi Kokubun) via ruby-core
2025-12-19 19:04 ` [ruby-core:124327] " rwstauner (Randy Stauner) via ruby-core
1 sibling, 0 replies; 3+ messages in thread
From: k0kubun (Takashi Kokubun) via ruby-core @ 2025-12-16 23:53 UTC (permalink / raw)
To: ruby-core; +Cc: k0kubun (Takashi Kokubun)
Issue #21266 has been updated by k0kubun (Takashi Kokubun).
Backport changed from 3.2: DONTNEED, 3.3: REQUIRED, 3.4: REQUIRED to 3.2: DONTNEED, 3.3: REQUIRED, 3.4: DONE
ruby_3_4 commit:d8f087b581735ec250b8671c3574fa4d5b16ae54 merged revision(s) commit:9168cad4d63a5d281d443bde4edea6be213b0b25.
----------------------------------------
Bug #21266: YJIT GC safety crash with proc objects as block argument
https://bugs.ruby-lang.org/issues/21266#change-115760
* Author: alanwu (Alan Wu)
* Status: Closed
* Assignee: jit
* Backport: 3.2: DONTNEED, 3.3: REQUIRED, 3.4: DONE
----------------------------------------
```ruby
# Run with --yjit-call-threshold=1
def foo(args) = bar(*args, &proc { _1 })
def bar(_, _, _, _, *rest) = yield rest
GC.stress = true
foo([1,2,3,4])
foo([1,2,3,4])
```
The proc in these calls get collected on the yield to the GC to allocate the rest parameter arary.
```
../vm_core.h:1668: Assertion Failed: vm_block_handler_type:rb_obj_is_proc(block_handler)
```
Or in release builds:
```
../test.rb:1: [BUG] Segmentation fault at 0x0000000000000020
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) +YJIT [arm64-darwin24]
-- C level backtrace information -------------------------------------------
/Users/alan/.rubies/ruby-3.3.6/bin/ruby(rb_vm_bugreport+0xb4c) [0x104595590]
/Users/alan/.rubies/ruby-3.3.6/bin/ruby(rb_bug_for_fatal_signal+0x100) [0x1043d6120]
/Users/alan/.rubies/ruby-3.3.6/bin/ruby(sig_do_nothing+0x0) [0x1044fc4b0]
/usr/lib/system/libsystem_platform.dylib(_sigtramp+0x38) [0x187572de4]
/Users/alan/.rubies/ruby-3.3.6/bin/ruby(rb_vm_invokeblock+0x144) [0x10456b004]
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ruby-core:124327] [Ruby Bug#21266] YJIT GC safety crash with proc objects as block argument
2025-04-13 13:20 [ruby-core:121642] [Ruby Bug#21266] YJIT GC safety crash with proc objects as block argument alanwu (Alan Wu) via ruby-core
2025-12-16 23:53 ` [ruby-core:124266] " k0kubun (Takashi Kokubun) via ruby-core
@ 2025-12-19 19:04 ` rwstauner (Randy Stauner) via ruby-core
1 sibling, 0 replies; 3+ messages in thread
From: rwstauner (Randy Stauner) via ruby-core @ 2025-12-19 19:04 UTC (permalink / raw)
To: ruby-core; +Cc: rwstauner (Randy Stauner)
Issue #21266 has been updated by rwstauner (Randy Stauner).
Backport PR for 3.3: https://github.com/ruby/ruby/pull/15657
----------------------------------------
Bug #21266: YJIT GC safety crash with proc objects as block argument
https://bugs.ruby-lang.org/issues/21266#change-115832
* Author: alanwu (Alan Wu)
* Status: Closed
* Assignee: jit
* Backport: 3.2: DONTNEED, 3.3: REQUIRED, 3.4: DONE
----------------------------------------
```ruby
# Run with --yjit-call-threshold=1
def foo(args) = bar(*args, &proc { _1 })
def bar(_, _, _, _, *rest) = yield rest
GC.stress = true
foo([1,2,3,4])
foo([1,2,3,4])
```
The proc in these calls get collected on the yield to the GC to allocate the rest parameter arary.
```
../vm_core.h:1668: Assertion Failed: vm_block_handler_type:rb_obj_is_proc(block_handler)
```
Or in release builds:
```
../test.rb:1: [BUG] Segmentation fault at 0x0000000000000020
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) +YJIT [arm64-darwin24]
-- C level backtrace information -------------------------------------------
/Users/alan/.rubies/ruby-3.3.6/bin/ruby(rb_vm_bugreport+0xb4c) [0x104595590]
/Users/alan/.rubies/ruby-3.3.6/bin/ruby(rb_bug_for_fatal_signal+0x100) [0x1043d6120]
/Users/alan/.rubies/ruby-3.3.6/bin/ruby(sig_do_nothing+0x0) [0x1044fc4b0]
/usr/lib/system/libsystem_platform.dylib(_sigtramp+0x38) [0x187572de4]
/Users/alan/.rubies/ruby-3.3.6/bin/ruby(rb_vm_invokeblock+0x144) [0x10456b004]
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-19 19:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-13 13:20 [ruby-core:121642] [Ruby Bug#21266] YJIT GC safety crash with proc objects as block argument alanwu (Alan Wu) via ruby-core
2025-12-16 23:53 ` [ruby-core:124266] " k0kubun (Takashi Kokubun) via ruby-core
2025-12-19 19:04 ` [ruby-core:124327] " rwstauner (Randy Stauner) via ruby-core
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).