-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AOT Engine Error: Class too large #453
Comments
Thanks for reporting! Might be related: #405 There is work being done to split methods that are too large. In the meantime could you try: That seemed to work for me when the compiled method was on the edge of being too big. |
You could also try some running |
I think it's in the same category as #405. I interpreted the error as ASM saying, "I can't generate your class bytecode because it is invalid." It seems to me that this step would come before the decision to natively compile the methods (e.g. rendering the DontCompileHugeMethods JVM arg irrelevant), is that correct or am I misunderstanding? I've tried wasm-opt, but the output wasms from various optimization levels are always unstable / crashy. |
Yes, definitely a different error and earlier in the process. I'm unsure if the method splitting work would address this const pool issue. @electrum is working on this and he would know. |
The |
If you could provide a reproduction, possibly based on #450, that would be helpful to ensure that the method splitting will work for this. What does your original method look like? |
The constant pool issue might require splitting the methods across multiple classes, as you suggest. It's hard to say what might be required without seeing an example of the WASM input. I'm not sure if there is a good generic solution to this problem, as it is easy to construct pathological cases given the much larger WASM limits compared to JVM bytecode. |
I can't supply the specific WASM, but I'll try to take a closer look at the class file that is attempting to be generated and try to get a grasp of what is going on there. |
Seeing what is in the constant pool would be helpful. |
@heroicefforts Could you send us a dump of the constant pool? You could obfuscate it if necessary. |
Very cool project.
I just wanted to report this edge case. I wrapped a .NET module from my employer and compiled using the .NET 9.0 Preview AOT LLVM compiler. It spits out a huge wasm file. It runs cleanly on the Chicory interpreter; albeit, slowly at 12 seconds for an invocation. I decided to give the nightly AOT compiler a shot, but it fails with the following error:
01:09:01.437 [main] ERROR Chicory - Const pool: 198793
org.objectweb.asm.ClassTooLargeException: Class too large: com/dylibso/chicory/$gen/CompiledModule
at org.objectweb.asm.ClassWriter.toByteArray(ClassWriter.java:622)
It appears that at 198793, the constant pool size is a smidge more than 3x the 65534 max size. Are there any plans to detect this condition and split the generated class?
Just as reference, the module will run cleanly on Wasmer's Python Cranelift compiler runtime and executes at 100ms for an invocation. However, that doesn't help support a Java based embedding.
The text was updated successfully, but these errors were encountered: