Skip to content

Included Timeout crashes when module method version of timeout used #3129

@kaiserprogrammer

Description

@kaiserprogrammer
require "rmodbus"
ModBus::TCPClient.connect("localhost", 502)

results in the following exception:

Timeout.java:299:in `getClassFrom': java.lang.ClassCastException: org.jruby.RubyObject cannot be cast to org.jruby.RubyModule
    from Timeout.java:295:in `getAnonymousException'
    from Timeout.java:158:in `timeout'
    from Timeout$INVOKER$s$timeout.gen:-1:in `call'
    from JavaMethod.java:575:in `call'
    from CachingCallSite.java:273:in `cacheAndCall'
    from CachingCallSite.java:79:in `callBlock'
    from CachingCallSite.java:83:in `call'
    from CallBase.java:419:in `interpret'
    from InterpreterEngine.java:321:in `processCall'
    from StartupInterpreterEngine.java:77:in `interpret'
    from MixedModeIRMethod.java:129:in `INTERPRET_METHOD'
    from MixedModeIRMethod.java:115:in `call'
    from CachingCallSite.java:273:in `cacheAndCall'
    from CachingCallSite.java:79:in `callBlock'
    from CachingCallSite.java:83:in `call'
    from CallBase.java:419:in `interpret'
    from InterpreterEngine.java:321:in `processCall'
    from StartupInterpreterEngine.java:77:in `interpret'
    from MixedModeIRMethod.java:129:in `INTERPRET_METHOD'
    from MixedModeIRMethod.java:115:in `call'
    from CachingCallSite.java:273:in `cacheAndCall'
    from CachingCallSite.java:79:in `callBlock'
    from CachingCallSite.java:83:in `call'
    from CallBase.java:419:in `interpret'
    from InterpreterEngine.java:321:in `processCall'
    from StartupInterpreterEngine.java:77:in `interpret'
    from InterpreterEngine.java:88:in `interpret'
    from MixedModeIRMethod.java:234:in `INTERPRET_METHOD'
    from MixedModeIRMethod.java:220:in `call'
    from CachingCallSite.java:343:in `cacheAndCall'
    from CachingCallSite.java:205:in `callBlock'
    from CachingCallSite.java:209:in `call'
    from RubyClass.java:867:in `newInstance'
    from RubyClass$INVOKER$i$newInstance.gen:-1:in `call'
    from JavaMethod.java:328:in `call'
    from AliasMethod.java:66:in `call'
    from CachingCallSite.java:333:in `cacheAndCall'
    from CachingCallSite.java:195:in `call'
    from /home/coder/gist/jruby_bug_test.rb:-1:in `invokeOther5:connect'
    from /home/coder/gist/jruby_bug_test.rb:4:in `RUBY$script'
    from MethodHandle.java:625:in `invokeWithArguments'
    from Compiler.java:111:in `load'
    from Ruby.java:821:in `runScript'
    from Ruby.java:813:in `runScript'
    from Ruby.java:751:in `runNormally'
    from Ruby.java:573:in `runFromMain'
    from Main.java:401:in `doRunFromMain'
    from Main.java:296:in `internalRun'
    from Main.java:225:in `run'
    from Main.java:197:in `main'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions