-
Notifications
You must be signed in to change notification settings - Fork 516
Description
When i made a simple if statement (Still learning java bytecode) i exported the app and while trying to run i got this error:
Exception in thread "main" java.lang.ClassFormatError: Duplicated LocalVariableTable attribute entry for '1' in class file com/desertkun/brainout/AuX/aux/jh at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at Aux.aux.aux.aux.do(BrainOut:839) at Aux.aux.aux.aux.getType(BrainOut:364) at com.desertkun.brainout.NUl.d.do(BrainOut:172) at com.desertkun.brainout.NUl.d.if(BrainOut:17) at Aux.aux.aux.aux$1.for(BrainOut:319) at Aux.aux.aux.aux.if(BrainOut:684) at Aux.aux.aux.aux.do(BrainOut:660) at Aux.aux.aux.aux.do(BrainOut:542) at Aux.aux.aux.aux.do(BrainOut:508) at Aux.aux.aux.aux.do(BrainOut:323) at com.desertkun.brainout.NUl.d.init(BrainOut:46) at com.desertkun.brainout.aux.<init>(BrainOut:58) at com.desertkun.brainout.con.<init>(BrainOut:91) at com.desertkun.brainout.desktop.aux.<init>(BrainOut:18) at com.desertkun.brainout.desktop.con.for(BrainOut:20) at com.desertkun.brainout.desktop.SteamLauncher.main(BrainOut:68)
To Reproduce
Steps to reproduce the behavior:
- Open a jar in recaf (
https://www.mediafire.com/file/2b2ont373j1wkz1/brainout-steam.jar/file) - Navigate to 'com/desertkun/brainout/AuX/aux/jh'
- Make an if statement in Assembler (setVisible function)
ILOAD 1
ICONST_1
IF_ICMPEQ then
ALOAD this
GETSTATIC com/badlogic/gdx/graphics/Color.RED Lcom/badlogic/gdx/graphics/Color;
PUTFIELD com/desertkun/brainout/AuX/aux/jh.color Lcom/badlogic/gdx/graphics/Color;
//GOTO A
LABEL then
ILOAD 1
ICONST_0
IF_ICMPEQ END
ALOAD this
GETSTATIC com/badlogic/gdx/graphics/Color.WHITE Lcom/badlogic/gdx/graphics/Color;
PUTFIELD com/desertkun/brainout/AuX/aux/jh.color Lcom/badlogic/gdx/graphics/Color;
LABEL END
- Export
- Run app and get this error
Activity
andylizi commentedon Jun 17, 2019
Well the simple and obvious solution will be striping all the
LocalVariableTableand be done with it. They are of no use in runtime anyway. Just turn on theSkip Debugcheckbox inConfig->ASM.Still worth investigating though. I'm guessing it's probably an ASM issue.
Edit: Huh. Guessed wrong 😁
Col-E commentedon Jun 17, 2019
Your code can be optimized:
While I look into this, deselect the checkbox
Local vars. This will stop Recaf from attempting to regenerate local variable debug information from the code you've written.artemking4 commentedon Jun 17, 2019
While pasting the code with comments to the Assembler i get nullpointerexception errors every edit i make here. And i can not touch ui anymore
Col-E commentedon Jun 17, 2019
Can you please share that
nullpointerexception?If the UI is frozen you can screenshot it.
artemking4 commentedon Jun 17, 2019
Ok, let me just reproduce it (Also it is hella big)

So this seems to error only if it is copied from an browser/notepad and so on, but not the assembler
artemking4 commentedon Jun 17, 2019
so its start is there:

Col-E commentedon Jun 17, 2019
Unrelated to the error, but I meant for you to replace the entire assembler code with what I posted, not adding it to the end.
Regarding the NPE shown in the logging pane down below: It's failing to map a set of old labels to new labels.
Should fix the follow-up error mentioned in #135 with the giant stack…
Add assembler test to verify #141 / #135 is fixed