-
-
Notifications
You must be signed in to change notification settings - Fork 943
Closed
Milestone
Description
Environment Information
- JRuby version: jruby 10.0.0.0-SNAPSHOT (3.4.2) 2025-03-13 a4e4d7d OpenJDK 64-Bit Server VM 21.0.6+7-Ubuntu-124.04.1 on 21.0.6+7-Ubuntu-124.04.1 +indy +jit [x86_64-linux]
- Operating system and platform: Ubuntu 24.04 / 6.8.0-1010-nvidia Become java statics #10-Ubuntu SMP PREEMPT_DYNAMIC Mon Jul 15 15:04:16 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Expected Behavior
TracePoint should work if we start a new thread. The following code shows the issue:
trace = TracePoint.new(:call) do |tp|
puts "Tracing: #{tp.path}:#{tp.lineno}"
end
trace.enable
def something(a, b)
result = yield a, b
"Result: #{result}"
end
def make_sum(a, b)
a + b
end
puts "Without a thread:"
something(10, 20) do |a, b|
make_sum(a, b)
end
puts "\nWith a thread:"
something(10, 20) do |a, b|
Thread.new do
make_sum(a, b)
end.join
endOn MRI, this prints:
Without a thread:
Tracing: /tmp/trace_example.rb:6
Tracing: /tmp/trace_example.rb:11
With a thread:
Tracing: /tmp/trace_example.rb:6
Tracing: /tmp/trace_example.rb:11
But on JRuby, this prints:
Without a thread:
Tracing: /tmp/trace_example.rb:6
Tracing: /tmp/trace_example.rb:11
With a thread:
Tracing: /tmp/trace_example.rb:6
Exporting JRUBY_OPTS='--debug' doesn't change the output
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels