ruby/bootstraptest
Rian McGuire 80a1a1bb8a
YJIT: Fix potential infinite loop when OOM (GH-13186)
Avoid generating an infinite loop in the case where:
1. Block `first` is adjacent to block `second`, and the branch from `first` to
   `second` is a fallthrough, and
2. Block `second` immediately exits to the interpreter, and
3. Block `second` is invalidated and YJIT is OOM

While pondering how to fix this, I think I've stumbled on another related edge case:
1. Block `incoming_one` and `incoming_two` both branch to block `second`. Block
   `incoming_one` has a fallthrough
2. Block `second` immediately exits to the interpreter (so it starts with its exit)
3. When Block `second` is invalidated, the incoming fallthrough branch from
   `incoming_one` might be rewritten first, which overwrites the start of block
   `second` with a jump to a new branch stub.
4. YJIT runs of out memory
5. The incoming branch from `incoming_two` is then rewritten, but because we're
   OOM we can't generate a new stub, so we use `second`'s exit as the branch
   target. However `second`'s exit was already overwritten with a jump to the
   branch stub for `incoming_one`, so `incoming_two` will end up jumping to
   `incoming_one`'s branch stub.

Fixes [Bug #21257]
2025-04-28 21:50:29 +09:00
..
pending.rb Moved already resolved test 2020-04-27 10:39:07 +09:00
runner.rb [Feature #21116] Extract RJIT as a third-party gem 2025-02-13 18:01:03 +09:00
test_attr.rb Revert "Revert "This commit implements the Object Shapes technique in CRuby."" 2022-10-11 08:40:56 -07:00
test_autoload.rb Use File.write instead of Kernel#open 2024-07-09 13:01:44 +09:00
test_block.rb
test_class.rb
test_constant_cache.rb Finer-grained constant cache invalidation (take 2) 2022-04-01 14:48:22 -04:00
test_env.rb fallback env encoding to ASCII-8BIT 2018-09-26 17:24:00 +00:00
test_eval.rb Raise a compile error for break/next/redo inside eval in cases where it is optimized away 2024-09-18 16:54:56 -07:00
test_exception.rb Do not include a backtick in error messages and backtraces 2024-02-15 18:42:31 +09:00
test_fiber.rb support concurrent btest execution 2022-02-06 03:05:47 +09:00
test_finalizer.rb Test finalizer is ran in bootstraptest 2024-04-01 10:26:16 -04:00
test_flip.rb
test_flow.rb Ensure test suite is compatible with --frozen-string-literal 2024-03-14 17:56:15 +01:00
test_fork.rb Fail test if child process exists non-zero 2025-03-25 19:14:26 -07:00
test_gc.rb [Feature #21116] Extract RJIT as a third-party gem 2025-02-13 18:01:03 +09:00
test_insns.rb Optimize instructions when creating an array just to call include? (#12123) 2024-11-26 14:31:08 -05:00
test_io.rb Use File.write instead of Kernel#open 2024-07-09 13:01:44 +09:00
test_jump.rb Ensure test suite is compatible with --frozen-string-literal 2024-03-14 17:56:15 +01:00
test_literal.rb Avoid array allocation for *nil, by not calling nil.to_a 2025-03-27 11:17:40 -07:00
test_literal_suffix.rb [PRISM] Enhance syntax error message extraction in test_literal_suffix btest 2024-04-03 17:34:12 -04:00
test_load.rb [Feature #21116] Extract RJIT as a third-party gem 2025-02-13 18:01:03 +09:00
test_marshal.rb
test_massign.rb
test_method.rb Fix assertion failure with anonymous splats 2025-04-02 19:31:05 -07:00
test_objectspace.rb Use a monotonically increasing number for object_id 2019-11-07 09:31:07 -08:00
test_proc.rb Make proc/Proc.new without block an error instead of warning 2020-06-10 17:49:54 -07:00
test_ractor.rb Lock-free hash set for fstrings [Feature #21268] 2025-04-18 13:03:54 +09:00
test_string.rb
test_struct.rb
test_syntax.rb [Feature #21116] Extract RJIT as a third-party gem 2025-02-13 18:01:03 +09:00
test_thread.rb [Feature #21116] Extract RJIT as a third-party gem 2025-02-13 18:01:03 +09:00
test_yjit.rb YJIT: Fix potential infinite loop when OOM (GH-13186) 2025-04-28 21:50:29 +09:00
test_yjit_30k_ifelse.rb * append newline at EOF. [ci skip] 2021-10-21 08:12:53 +09:00
test_yjit_30k_methods.rb * append newline at EOF. [ci skip] 2021-10-21 08:12:53 +09:00
test_yjit_rust_port.rb Rust YJIT 2022-04-27 11:00:22 -04:00