Linkage error on recent JDKs

Charles Oliver Nutter headius at headius.com
Thu Feb 23 15:28:05 PST 2012


I just started getting this after fixing a separate bug and attempting
to get JRuby's indy mode green again:

    [junit] Java::JavaLang::LinkageError: loader constraint violation:
when resolving method
"rubyjit.Test::Unit::Util::Observable#channels_11ACD19FA2F79CAEAFF634B776F6E40ABB76C535.__file__(Lrubyjit/Test::Unit::Util::Observable#channels_11ACD19FA2F79CAEAFF634B776F6E40ABB76C535;Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;"
the class loader (instance of <bootloader>) of the current class,
java/lang/invoke/MethodHandle, and the class loader (instance of
org/jruby/util/ClassCache$OneShotClassLoader) for resolved class,
rubyjit/Test::Unit::Util::Observable#channels_11ACD19FA2F79CAEAFF634B776F6E40ABB76C535,
have different Class objects for the type
it::Util::Observable#channels_11ACD19FA2F79CAEAFF634B776F6E40ABB76C535.__file__(Lrubyjit/Test::Unit::Util::Observable#channels_11ACD19FA2F79CAEAFF634B776F6E40ABB76C535;Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;
used in the signature
    [junit]     java.lang.invoke.MethodHandle.invokeExact(MethodHandle.java)
    [junit]     java.lang.invoke.MethodHandle.invokeExact(MethodHandle.java)
    [junit]     java.lang.invoke.MethodHandle.invokeExact(MethodHandle.java)
    [junit]     java.lang.invoke.MethodHandle.invokeExact(MethodHandle.java)
    [junit]     java.lang.invoke.MethodHandle.invokeExact(MethodHandle.java)
    [junit]
rubyjit.Test::Unit::Util::Observable#notify_listeners_07DE47B0B6EC4E70B332613A51D626F7D22BB20E.__file__(/Users/headius/projects/jruby/lib/ruby/1.8/test/unit/util/observable.rb:75)

My reading of this error online tells me somehow this code path is
getting the wrong generated class after it has already linked another
one...or something. I'm not sure what I'm doing that would cause
this...continuing to investigate. I obviously never see this without
indy enabled, so naturally I suspect indy is involved :)

I do see something interesting in the message. It says "the class
loader (instance of <bootloader>) of the current class,
java/lang/invoke/MethodHandle, and the class loader (instance of
org/jruby/util/ClassCache$OneShotClassLoader) for resolved class,
rubyjit/Test::Unit::Util::Observable#channels_11ACD19FA2F79CAEAFF634B776F6E40ABB76C535,
have different Class objects for the type..." I know for a fact that
no jitted methods should ever get loaded at the bootstrap level, so
this feels like old classloader + indy problems showing up in a
different way...

- Charlie


More information about the mlvm-dev mailing list