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
I'm working on refreshing our tags for the MRI tests. While doing so, I ran into a situation where a Java exception is escaping into Ruby when exiting a Monitor incorrectly.
The following code should raise a ThreadError, but instead we're triggering a ShouldNotReachHere exception.
require'monitor'm=Monitor.newm.exit
On MRI, we see the ThreadError we expect:
> ruby -v bad-monitor.rb
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [arm64-darwin22]
bad-monitor.rb:4:in `exit': current fiber not owner (ThreadError)
from bad-monitor.rb:4:in `<main>'
On TruffleRuby we end up an escaped Java exception.
> jt ruby -v bad-monitor.rb
truffleruby 23.0.0-dev-671182fb*, like ruby 3.1.3, GraalVM CE JVM [aarch64-darwin]
truffleruby: an internal exception escaped out of the interpreter,
please report it to https://github.com/oracle/truffleruby/issues.
the lock was not held when calling unlockInternal() (com.oracle.truffle.api.CompilerDirectives.ShouldNotReachHere)
from com.oracle.truffle.api.CompilerDirectives.shouldNotReachHere(CompilerDirectives.java:574)
from com.oracle.truffle.api.CompilerDirectives.shouldNotReachHere(CompilerDirectives.java:520)
from org.truffleruby.core.mutex.MutexOperations.unlockInternal(MutexOperations.java:112)
from org.truffleruby.core.mutex.MutexOperations.unlock(MutexOperations.java:105)
from org.truffleruby.core.monitor.TruffleMonitorNodes$MonitorExit.exit(TruffleMonitorNodes.java:83)
from org.truffleruby.core.monitor.TruffleMonitorNodesFactory$MonitorExitFactory$MonitorExitNodeGen.executeAndSpecialize(TruffleMonitorNodesFactory.java:476)
from org.truffleruby.core.monitor.TruffleMonitorNodesFactory$MonitorExitFactory$MonitorExitNodeGen.execute(TruffleMonitorNodesFactory.java:467)
from org.truffleruby.language.control.SequenceNode.execute(SequenceNode.java:37)
from org.truffleruby.language.RubyMethodRootNode.execute(RubyMethodRootNode.java:65)
/Users/nirvdrum/dev/workspaces/truffleruby-ws/graal/sdk/mxbuild/darwin-aarch64/GRAALVM_A33290E019_JAVA17/graalvm-a33290e019-java17-23.0.0-dev/Contents/Home/languages/ruby/lib/mri/monitor.rb:194:in `mon_exit'
from bad-monitor.rb:4:in `<main>'
The text was updated successfully, but these errors were encountered:
I'm working on refreshing our tags for the MRI tests. While doing so, I ran into a situation where a Java exception is escaping into Ruby when exiting a
Monitor
incorrectly.The following code should raise a
ThreadError
, but instead we're triggering aShouldNotReachHere
exception.On MRI, we see the
ThreadError
we expect:On TruffleRuby we end up an escaped Java exception.
The text was updated successfully, but these errors were encountered: