[#104740] [Ruby master Feature#18057] Introduce Array#average — ggmichaelgo@...

Issue #18057 has been reported by ggmichaelgo (Michael Go).

14 messages 2021/08/02

[#104774] [Ruby master Bug#18061] Execshield test: libruby.so.N.N.N: FAIL: property-note test because no .note.gnu.property section found — jaruga@...

Issue #18061 has been reported by jaruga (Jun Aruga).

48 messages 2021/08/04

[#104780] [Ruby master Bug#18062] Ruby with enabled LTO segfaults during build — v.ondruch@...

Issue #18062 has been reported by vo.x (Vit Ondruch).

30 messages 2021/08/05

[#104831] [Ruby master Bug#18066] Load did_you_mean eve/error_highlight even with --disable-gems — v.ondruch@...

Issue #18066 has been reported by vo.x (Vit Ondruch).

10 messages 2021/08/07

[#104851] [Ruby master Bug#18073] test/ruby/test_jit.rb: failures "error: invalid use of '__builtin_va_arg_pack ()'" on Ruby 2.7.4 on gcc 4.8.5 on RHEL7 — jaruga@...

Issue #18073 has been reported by jaruga (Jun Aruga).

14 messages 2021/08/09

[#104927] [Ruby master Bug#18077] Marshal.dump(closed_io) raises IOError instead of TypeError — "larskanis (Lars Kanis)" <noreply@...>

Issue #18077 has been reported by larskanis (Lars Kanis).

10 messages 2021/08/16

[#104960] [Ruby master Feature#18083] Capture error in ensure block. — "ioquatix (Samuel Williams)" <noreply@...>

Issue #18083 has been reported by ioquatix (Samuel Williams).

32 messages 2021/08/18

[#105021] [Ruby master Misc#18122] DevelopersMeeting20210916Japan — "mame (Yusuke Endoh)" <noreply@...>

Issue #18122 has been reported by mame (Yusuke Endoh).

12 messages 2021/08/20

[#105069] [Ruby master Bug#18133] LTO: TestGCCompact#test_ast_compacts segfaults on i686 — "vo.x (Vit Ondruch)" <noreply@...>

Issue #18133 has been reported by vo.x (Vit Ondruch).

25 messages 2021/08/25

[#105077] [Ruby master Feature#18136] take_while_after — "zverok (Victor Shepelev)" <noreply@...>

Issue #18136 has been reported by zverok (Victor Shepelev).

21 messages 2021/08/27

[ruby-core:104892] [Ruby master Bug#17507] Regexp capture groups ignored sometimes in some multithreaded environments (possible race condition)

From: merch-redmine@...
Date: 2021-08-11 22:01:12 UTC
List: ruby-core #104892
Issue #17507 has been updated by jeremyevans0 (Jeremy Evans).


This issue is due to a race condition because the MatchData object is passed indirectly through the backref.  I've submitted a pull request to fix it: https://github.com/ruby/ruby/pull/4734

I think it's likely that similar Regexp methods have a similar issue, though I haven't done any testing in that area.

----------------------------------------
Bug #17507: Regexp capture groups ignored sometimes in some multithreaded environments (possible race condition)
https://bugs.ruby-lang.org/issues/17507#change-93252

* Author: byteit101 (Patrick Plenefisch)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Same behavior from 2.6-3.0
OS: Debian 10

Ruby Script:

``` ruby
TargetStr = "a-x-foo-bar-baz-z-b"

worker = lambda do
	# For more hits, use File.read here instead of TargetStr
	m = TargetStr.match(/foo-([A-Za-z0-9_\.]+)-baz/) # more cases in the []+ means more hits
	raise "Error, #{m.inspect}" if m[1].nil?
	File.exist? "/tmp"
	TargetStr.gsub(/foo-bar-baz/, "foo-abc-baz") # must match the same as the first match
end

def threaded_test(worker)
	6.times.map {Thread.new {10_000.times {worker.call}}}.each(&:join)
end
threaded_test(worker) # must be a function calling a block or proc or lambda. Change any of that and it doesn't hit this

puts "No Error Hits"
```

Result of script (number of exceptions varies per-run):

```
#<Thread:0x00005616663dba08 bug.rb:12 run> terminated with exception (report_on_exception is true):
bug.rb:6:in `block in <main>': Error, #<MatchData "foo-bar-baz"> (RuntimeError)
	from bug.rb:12:in `block (3 levels) in threaded_test'
	from bug.rb:12:in `times'
	from bug.rb:12:in `block (2 levels) in threaded_test'
#<Thread:0x00005616663db5f8 bug.rb:12 run> terminated with exception (report_on_exception is true):
bug.rb:6:in `block in <main>': Error, #<MatchData "foo-bar-baz"> (RuntimeError)
	from bug.rb:12:in `block (3 levels) in threaded_test'
	from bug.rb:12:in `times'
	from bug.rb:12:in `block (2 levels) in threaded_test'
#<Thread:0x00005616663dbb98 bug.rb:12 run> terminated with exception (report_on_exception is true):
bug.rb:6:in `block in <main>': Error, #<MatchData "foo-bar-baz"> (RuntimeError)
	from bug.rb:12:in `block (3 levels) in threaded_test'
	from bug.rb:12:in `times'
	from bug.rb:12:in `block (2 levels) in threaded_test'
bug.rb:6:in `block in <main>': Error, #<MatchData "foo-bar-baz"> (RuntimeError)
	from bug.rb:12:in `block (3 levels) in threaded_test'
	from bug.rb:12:in `times'
	from bug.rb:12:in `block (2 levels) in threaded_test'
```

Expected Result:

```
No Error Hits
```

Details:

As is, it usually errors (most of the time it fails about 300-500 iterations in)
A success is what is expected, m == #&lt;MatchData "foo-bar-baz" 1:"bar">
An error is when m == #&lt;MatchData "foo-bar-baz"> (no capture saved)

* If threaded_test is only one thread (1.times) it always works. For more than one thread, it usually errors.
* If File.exist? is removed, it always works.
* If the gsub is removed, it always works.
* If the gsub is changed to not match the match() call, it always works.
* If the match expression is simpler (/foo-(bar)-baz/, or even /foo-([a-z]+)-baz/), it usually works.
* If the threaded_test is not a method, but executed inline (ie, comment out the def, end, call, on lines 11 & 13-14) it always works.
* If worker is a block, or a lambda (as provided), it usually errors.
* If worker is put inline into the 10_000.times call, it always works.
* If TargetStr matches on index 0, it always works.





-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread