1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test
Jeremy Evans abc0304cb2 Avoid race condition in Regexp#match
In certain conditions, Regexp#match could return a MatchData with
missing captures.  This seems to require at the least, multiple
threads calling a method that calls the same block/proc/lambda
which calls Regexp#match.

The race condition happens because the MatchData is passed from
indirectly via the backref, and other threads can modify the
backref.

Fix the issue by:

1. Not reusing the existing MatchData from the backref, and always
   allocating a new MatchData.
2. Passing the MatchData directly to the caller using a VALUE*,
   instead of indirectly through the backref.

It's likely that variants of this issue exist for other Regexp
methods.  Anywhere that MatchData is passed implicitly through
the backref is probably vulnerable to this issue.

Fixes [Bug #17507]
2021-10-01 19:50:19 -09:00
..
-ext- Use Test::Unit::AssertionFailedError instead of MiniTest::Assertion for test-unit migration 2021-09-06 18:34:15 +09:00
base64
benchmark
bigdecimal
cgi
coverage Check type of instruction - can be INSN or ADJUST 2021-06-23 11:34:37 -07:00
csv
date [ruby/date] Make %v strftime flag use uppercase month 2021-09-28 17:34:26 +09:00
did_you_mean [ruby/did_you_mean] Disable error_highlight when testing did_you_mean 2021-09-28 17:48:57 +09:00
digest [ruby/digest] Use pend instead of skip 2021-07-28 11:48:36 +09:00
drb [ruby/drb] Use omit instead of skip for test-unit 2021-09-28 17:31:08 +09:00
dtrace
erb
error_highlight [ruby/error_highlight] Fixed the argument for DidYouMean.formatter= 2021-08-20 16:27:07 +09:00
etc
excludes Stop stale tests [Bug #9718] 2021-09-02 01:39:01 +09:00
fiber Add alternative optional hook for scheduler_close to allow public usage of close. 2021-09-20 22:07:58 +12:00
fiddle [ruby/fiddle] Use test-unit gem (https://github.com/ruby/fiddle/pull/69) 2021-09-05 17:43:48 +09:00
fileutils Use Test::Unit::AssertionFailedError instead of MiniTest::Assertion for test-unit migration 2021-09-06 18:34:15 +09:00
fixtures/fake_sorted_set_gem
io
irb Pend test_complete_require_library_name_first 2021-09-24 22:56:38 +09:00
json
lib
logger [ruby/logger] Ignored loading CoreAssertions in test runner 2021-09-15 08:49:24 +09:00
mkmf mkmf.rb: try linking at try_var 2021-07-08 18:18:35 +09:00
monitor Distinguish signal and timeout [Bug #16608] 2021-07-25 13:09:03 -07:00
net [ruby/net-http] Use omit instead of skip for test-unit 2021-09-11 10:25:34 +09:00
nkf
objspace
open-uri Guard for the ftp protocol feature of OpenURI 2021-05-27 14:42:11 +09:00
openssl Use Test::Unit::PendedError instead of MiniTest::Skip for test-unit migration 2021-09-06 19:33:56 +09:00
optparse
ostruct [ruby/ostruct] Allow properties to be accessed even when the object is moved to another Ractor (https://github.com/ruby/ostruct/pull/29) 2021-09-28 17:30:06 +09:00
pathname [ruby/pathname] Prefer omit over skip 2021-09-07 13:02:56 +09:00
psych test/psych/test_scalar_scanner.rb: Prevent a warning 2021-09-09 23:35:03 +09:00
racc [ruby/racc] Prefer __dir__ over File.dirname(__FILE__) 2021-09-15 16:20:18 +09:00
rdoc Fixed leaked file descriptor 2021-09-13 09:36:42 +09:00
readline [ruby/readline-ext] Omit Editline on without tty test 2021-09-03 03:34:09 +09:00
reline [ruby/reline] Support ed_argument_digit by M+num 2021-09-29 22:07:49 +09:00
resolv
rinda
ripper Hash values should be omitted in Ripper results 2021-09-11 22:03:10 +09:00
ruby Avoid race condition in Regexp#match 2021-10-01 19:50:19 -09:00
rubygems [rubygems/rubygems] Only disallow FIXME/TODO for first word of gemspec description 2021-09-28 17:43:42 +09:00
socket Use Test::Unit::AssertionFailedError instead of MiniTest::Assertion for test-unit migration 2021-09-06 18:34:15 +09:00
stringio
strscan
syslog
uri Update to latest uri 2021-07-28 12:26:31 +02:00
win32ole
yaml Prefer qualified names under Thread 2021-06-29 11:41:10 +09:00
zlib Use Test::Unit::AssertionFailedError instead of MiniTest::Assertion for test-unit migration 2021-09-06 18:34:15 +09:00
runner.rb Fix bundled gems locations 2021-07-30 12:21:38 +09:00
test_abbrev.rb
test_delegate.rb
test_extlibs.rb
test_find.rb
test_forwardable.rb
test_ipaddr.rb
test_mutex_m.rb
test_observer.rb
test_open3.rb
test_pp.rb
test_prettyprint.rb
test_pstore.rb Prefer qualified names under Thread 2021-06-29 11:41:10 +09:00
test_pty.rb
test_rbconfig.rb
test_securerandom.rb
test_set.rb [ruby/set] Allow Set#intersect? and #disjoint? to accept array argument 2021-07-29 14:18:10 +09:00
test_shellwords.rb
test_singleton.rb
test_sorted_set.rb
test_syslog.rb
test_tempfile.rb
test_time.rb
test_timeout.rb [ruby/timeout] test that yield is given number of seconds 2021-09-28 06:05:50 +09:00
test_tmpdir.rb
test_trick.rb
test_tsort.rb
test_unicode_normalize.rb
test_weakref.rb