[#111712] [Ruby master Feature#19322] Support spawning "private" child processes — "kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core" <ruby-core@...>
SXNzdWUgIzE5MzIyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGtqdHNhbmFrdHNpZGlzIChLSiBUc2Fu
14 messages
2023/01/07
[ruby-core:111960] [Ruby master Bug#19364] Issue with tracepoint enable/disable across ractors
From:
"luke-gru (Luke Gruber) via ruby-core" <ruby-core@...>
Date:
2023-01-21 22:54:58 UTC
List:
ruby-core #111960
Issue #19364 has been reported by luke-gru (Luke Gruber).
----------------------------------------
Bug #19364: Issue with tracepoint enable/disable across ractors
https://bugs.ruby-lang.org/issues/19364
* Author: luke-gru (Luke Gruber)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
This sometimes segfaults:
```ruby
def test_enable_disable_in_multiple_ractors_with_target
rs = []
100.times do |i|
# setup new iseqs
Kernel.define_method :"my_method_to_change_for_tracing_#{i}" do
true
end
end
100.times do |i|
rs << Ractor.new(i) do |j|
meth = :"my_method_to_change_for_tracing_#{j}"
tp = TracePoint.new(:line) { } # local to ractor
100.times do
tp.enable(target: method(meth)) # change iseq internals of given method, should be done with lock
tp.disable # disable hooks should hold lock too, changes method definition internals
end
end
end
rs.each(&:take) # shouldn't raise
end
test_enable_disable_in_multiple_ractors_with_target()
```
Changing iseq internals is done without the VM lock. This is true in Tracepoint#enable and Tracepoint#disable methods.
I have a patch coming.
--
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/postorius/lists/ruby-core.ml.ruby-lang.org/