You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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}"endtrace.enabledefsomething(a,b)result=yielda,b"Result: #{result}"enddefmake_sum(a,b)a + bendputs"Without a thread:"something(10,20)do |a,b|
make_sum(a,b)endputs"\nWith a thread:"something(10,20)do |a,b|
Thread.newdomake_sum(a,b)end.joinend
On 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
Environment Information
Expected Behavior
TracePointshould work if we start a new thread. The following code shows the issue:On MRI, this prints:
But on JRuby, this prints:
Exporting
JRUBY_OPTS='--debug'doesn't change the output