#303 IKVM8 Internal Compiler Error: get_Interfaces called on UnloadableTypeWrapper

v1.0 (example)
closed-fixed
nobody
4
2015-08-26
2015-08-26
Richard
No

First of all, thank you very much for such a marvellous tool!

I'm passing to IKVM8 a complex set of calls to ikvmc based on a large dependency tree consisting of more than 250 JAR files, and I'm breaking the IKVM compiler. The bug is reproducible, but the library files are 150 MB in size, even when compressed, and SourceForge is dropping my connection before I can finish uploading the ZIP file. I therefore am forced to just submit the output files and the batch file, and will have to get the libraries to you by another means. I have three output files, one for IKVM 8.1.5666.0, one for IKVM 8.0.5449.1, and one for IKVM 7.2.4630.5. Both of the IKVM 8 compilers produce the same error message, whereas IKVM 7.2.4630.5 produces no error message. That said, IKVM 7.2.4630.5 fails to convert my desired "hello-world" JAR library to a DLL file, with a statement that a class named "void" is missing. IKVM 8 also may fail to do so -- I'm not sure because the application helpfully produces more error messages earlier during compilation (and I do mean that I think it is helpful because it is flagging references that need to be included in the ikvmc commands). Here is the output for IKVM 8.0.5449.1:


IKVM.NET Compiler version 8.0.5449.1
Copyright (C) 2002-2014 Jeroen Frijters
http://www.ikvm.net/

note IKVMC0002: Output file is "grails-plugin-mimetypes-3.0.4.dll"

INTERNAL COMPILER ERROR

PLEASE FILE A BUG REPORT FOR IKVM.NET WHEN YOU SEE THIS MESSAGE

ikvmc, Version=8.0.5449.1, Culture=neutral, PublicKeyToken=13235d27fcbfff58
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\ 2.0.50727.8009 64-bit

System.InvalidOperationException: get_Interfaces called on UnloadableTypeWrapper: grails.config.ConfigMap
at IKVM.Internal.UnloadableTypeWrapper.get_Interfaces()
at IKVM.Internal.TypeWrapper.ImplementsInterface(TypeWrapper interfaceWrapper)
at IKVM.Internal.TypeWrapper.ImplementsInterface(TypeWrapper interfaceWrapper)
at MethodAnalyzer.VerifyInvokePassTwo(Int32 index)
at MethodAnalyzer.VerifyPassTwo()
at MethodAnalyzer..ctor(TypeWrapper host, TypeWrapper wrapper, MethodWrapper mw, ClassFile classFile, Method method, ClassLoaderWrapper classLoader)
at Compiler..ctor(FinishContext context, TypeWrapper host, DynamicTypeWrapper clazz, MethodWrapper mw, ClassFile classFile, Method m, CodeEmitter ilGenerator, ClassLoaderWrapper classLoader)
at Compiler.Compile(FinishContext context, TypeWrapper host, DynamicTypeWrapper clazz, MethodWrapper mw, ClassFile classFile, Method m, CodeEmitter ilGenerator, Boolean& nonleaf)
at IKVM.Internal.DynamicTypeWrapper.FinishContext.FinishImpl()
at IKVM.Internal.DynamicTypeWrapper.JavaTypeImpl.FinishCore()
at IKVM.Internal.DynamicTypeWrapper.JavaTypeImpl.Finish()
at IKVM.Internal.AotTypeWrapper.Finish()
at IKVM.Internal.DynamicClassLoader.FinishAll()
at IKVM.Internal.CompilerClassLoader.Compile(String runtimeAssembly, List`1 optionsList)
at IkvmcCompiler.Compile(String[] args)
at IkvmcCompiler.Main(String[] args)


ADDITIONAL INFORMATION

  1. Previously in the output (line 37,501 of the output for version 8.1.5666.0) I see:

IKVM.NET Compiler version 8.1.5666.0
Copyright (C) 2002-2015 Jeroen Frijters
http://www.ikvm.net/

note IKVMC0002: Output file is "grails-web-url-mappings-3.0.4.dll"
warning IKVMC0100: Class "org.fusesource.jansi.Ansi" not found
warning IKVMC0100: Class "org.fusesource.jansi.Ansi$Attribute" not found
warning IKVMC0100: Class "org.fusesource.jansi.Ansi$Color" not found
warning IKVMC0100: Class "void" not found


I have a feeling that "void" is not an actual class, so speaking as someone unfamiliar with the code base, I think that might be a good place to start looking for the cause of this bug. That said, at the time of submission of this bug I have not actually looked for a call to void() in that library. The compiler error suggests that regardless of the cause, there's a bug that you're going to want to fix.

  1. This is not the first attempt I've made to compile these library files. Previous scans produced output such as the following:

IKVM.NET Compiler version 8.0.5449.1
Copyright (C) 2002-2014 Jeroen Frijters
http://www.ikvm.net/

note IKVMC0002: Output file is "grails-web-jsp-3.0.4.dll"
error IKVMC4015: The type 'org.springframework.web.servlet.handler.DispatcherServletWebRequest' is defined in an assembly that is not referenced. You must add a reference to assembly 'spring-webmvc-4.1.7.RELEASE, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
IKVM.NET Compiler version 8.0.5449.1
Copyright (C) 2002-2014 Jeroen Frijters
http://www.ikvm.net/

note IKVMC0002: Output file is "grails-web-gsp-taglib-3.0.4.dll"
warning IKVMC0100: Class "void" not found
error IKVMC4015: The type 'org.springframework.web.servlet.view.AbstractUrlBasedView' is defined in an assembly that is not referenced. You must add a reference to assembly 'spring-webmvc-4.1.7.RELEASE, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

INTERNAL COMPILER ERROR

PLEASE FILE A BUG REPORT FOR IKVM.NET WHEN YOU SEE THIS MESSAGE

ikvmc, Version=8.0.5449.1, Culture=neutral, PublicKeyToken=13235d27fcbfff58
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\ 2.0.50727.8009 64-bit

System.InvalidOperationException: get_Interfaces called on UnloadableTypeWrapper: org.springframework.web.servlet.view.AbstractUrlBasedView
at IKVM.Internal.UnloadableTypeWrapper.get_Interfaces()
at IKVM.Internal.TypeWrapper.GetFieldWrapper(String fieldName, String fieldSig)
at IKVM.Internal.ClassFile.ConstantPoolItemFieldref.Link(TypeWrapper thisType)
at IKVM.Internal.ClassFile.Link(TypeWrapper thisType)
at IKVM.Internal.DynamicTypeWrapper.JavaTypeImpl.Finish()
at IKVM.Internal.AotTypeWrapper.Finish()
at IKVM.Internal.DynamicClassLoader.FinishAll()
at IKVM.Internal.CompilerClassLoader.Compile(String runtimeAssembly, List`1 optionsList)
at IkvmcCompiler.Compile(String[] args)
at IkvmcCompiler.Main(String[] args)"


Accordingly, at first I believed the absence of a reference to a necessary dependency when converting a JAR file (such as "grails-web-jsp-3.0.4.dll" in the above example) to a DLL was the cause of the internal compiler error that appears a few lines later in the output. I therefore added the recommended reference to my batch file and proceeded to run the batch file again. In the attached example, however, the internal compiler error occurs prior to the appearance of any error messages.

  1. Just for comparison, I ran the same batch file using IKVM 7.2.4630.5. As you no doubt know, IKVM8 (or at least versions of IKVM after 7.2.4630.5) throws an error message when some JAR library B.jar contains a reference to class foo that is defined in A.jar, when A.jar has already been converted to A.dll in the same batch file and when B.jar does not reference A.jar (i.e. the call to IKVMC is "ikvmc B.jar" instead of "ikvmc B.jar -r:A.dll"). IKVM 7.2.4630.5, in comparison, would simply throw a warning that class foo is not found when converting A.jar to A.dll. Running IKVM 7.2.4630.5 with the same batch file produces no internal compiler error messages, but ultimately my JAR file of interest ("hello-world.jar") does not properly convert to a complete "hello-world.dll" because "hello-world.dll" is deemed to be missing a class with name "void":

IKVM.NET Compiler version 7.2.4630.5
Copyright (C) 2002-2012 Jeroen Frijters
http://www.ikvm.net/

note IKVMC0002: Output file is "hello-world.dll"
warning IKVMC0100: Class "void" not found


Hopefully these symptoms will help you to identify the problem.

I run quite a number of large batch files like these, which can be helpful for catching bugs; I'm quite happy to report more of these going forward. Please let me know how to get these library files to you, and thank you again!

Sincerely,

Richard

1 Attachments

Discussion

  • Jeroen Frijters

    Jeroen Frijters - 2015-08-26

    Thanks for the report. I'm currently building a fix.

     
  • Richard

    Richard - 2015-08-26

    That was fast, thanks very much! If you find you need the library files, just ping me.

     
  • Jeroen Frijters

    Jeroen Frijters - 2015-08-26

    BTW, doing "ikvmc rt.jar -target:library" is not a good idea. IKVM comes with its own Java class library and you can't mix in another one.

     
  • Richard

    Richard - 2015-08-26

    Got it, thanks. Sounds like I'll be posting a question to the forum shortly. Let me test this first and get right back to you.

     
  • Richard

    Richard - 2015-08-26

    ...and I can confirm that I'm no longer getting that error message and am able to proceed! Hooray!!

     
  • Richard

    Richard - 2015-08-26

    BTW, it appears that the build you just posted (8.1.5716) is still configured to print debugging information to the console, I'm not sure if you intended that. No complaints over here, though. That was really fast.

     
  • Jeroen Frijters

    Jeroen Frijters - 2015-08-26

    Oops. I zipped the wrong directory. It also includes some other changes still in development, so it's probably better to re-download the correct version I just put up.
    Thanks for testing and the heads up.

     
  • Jeroen Frijters

    Jeroen Frijters - 2015-08-26
    • status: open --> closed-fixed
     
  • Jeroen Frijters

    Jeroen Frijters - 2015-08-26

    Fixed in cvs.

     
  • Richard

    Richard - 2015-08-26

    Sure, thank you. (And the version you just posted fixes the bug as well.)

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks