diff options
author | Samuel Williams <[email protected]> | 2025-06-05 12:49:02 +0900 |
---|---|---|
committer | Samuel Williams <[email protected]> | 2025-06-06 13:13:16 +0900 |
commit | ead14b19aa5acbdfb2f1ccc53cc7b8b34517b6e9 (patch) | |
tree | 5070560cb4326d1d209d81e2aed6dfcd29f28bf6 /test | |
parent | 81a23c5793fecaff5f75cefe6a6e03dab99df16b (diff) |
Fix `blocking_operation_wait` use-after-free bug.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13437
Diffstat (limited to 'test')
-rw-r--r-- | test/fiber/scheduler.rb | 2 | ||||
-rw-r--r-- | test/fiber/test_io_close.rb | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/test/fiber/scheduler.rb b/test/fiber/scheduler.rb index 26a807c8c5..2401cb30d3 100644 --- a/test/fiber/scheduler.rb +++ b/test/fiber/scheduler.rb @@ -341,7 +341,7 @@ class Scheduler end def blocking_operation_wait(work) - thread = Thread.new(&work) + thread = Thread.new{work.call} thread.join diff --git a/test/fiber/test_io_close.rb b/test/fiber/test_io_close.rb index 411d709359..742b40841d 100644 --- a/test/fiber/test_io_close.rb +++ b/test/fiber/test_io_close.rb @@ -16,9 +16,8 @@ class TestFiberIOClose < Test::Unit::TestCase end end - # Problematic on Windows. def test_io_close_across_fibers - omit "Interrupting a io_wait read is not supported!" if RUBY_PLATFORM =~ /mswin|mingw/ + # omit "Interrupting a io_wait read is not supported!" if RUBY_PLATFORM =~ /mswin|mingw/ with_socket_pair do |i, o| error = nil @@ -45,7 +44,6 @@ class TestFiberIOClose < Test::Unit::TestCase end end - # Okay on all platforms. def test_io_close_blocking_thread omit "Interrupting a io_wait read is not supported!" if RUBY_PLATFORM =~ /mswin|mingw/ @@ -77,9 +75,8 @@ class TestFiberIOClose < Test::Unit::TestCase end end - # Problematic on Windows. def test_io_close_blocking_fiber - omit "Interrupting a io_wait read is not supported!" if RUBY_PLATFORM =~ /mswin|mingw/ + # omit "Interrupting a io_wait read is not supported!" if RUBY_PLATFORM =~ /mswin|mingw/ with_socket_pair do |i, o| error = nil |