You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when using soot as an optimizing tool, a generated class file can not run since it refused by java verification.
error message:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
E1.foo(II)I @13: iload_3
Reason:
Type top (current frame, locals[3]) is not assignable to integer
Current Frame:
bci: @13
flags: { }
locals: { 'java/lang/Exception', integer, integer }
stack: { }
Bytecode:
0x0000000: 1b04 603e bb00 0d59 b700 0ebf 4b1d 0460
0x0000010: ac
Exception Handler Table:
bci [0, 12] => handler: 12
Stackmap Table:
same_locals_1_stack_item_frame(@12,Object[#13])
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
I have been already check the java file version and the byte code, but not found any suspicious.
It's a very small class file:
before soot:
int foo(int, int);
descriptor: (II)I
flags:
Code:
stack=2, locals=4, args_size=3
0: iload_1
1: iconst_1
2: iadd
3: istore_1
4: new #2 // class java/lang/Exception
7: dup
8: invokespecial #3 // Method java/lang/Exception."<init>":()V
11: athrow
12: astore_3
13: iload_1
14: iconst_1
15: iadd
16: istore_1
17: iload_1
18: ireturn
Exception table:
from to target type
0 12 12 Class java/lang/Exception
after soot:
int foo(int, int);
descriptor: (II)I
flags:
Code:
stack=2, locals=4, args_size=3
0: iload_1
1: iconst_1
2: iadd
3: istore_3
4: new #13 // class java/lang/Exception
7: dup
8: invokespecial #14 // Method java/lang/Exception."<init>":()V
11: athrow
12: astore_0
13: iload_3
14: iconst_1
15: iadd
16: ireturn
Exception table:
from to target type
0 12 12 Class java/lang/Exception
test java file:
publicclassE1 {
intfoo(inta, intb) {
try{
a = a + 1;
thrownewException();
}catch (Exceptione){
a = a + 1;
}
returna;
}
publicstaticvoidmain(Stringargs[]){
System.out.println(newE1().foo(1, 2));
}
}
My java version:
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
the problem is that JVM check the class file in each entry separately, in this test case, 12: astore_0 as an entry, but local[3] not initialized.
Maybe it can add a transform to check this situation or fix Jimple in jtp process to solve it.
The text was updated successfully, but these errors were encountered:
when using soot as an optimizing tool, a generated class file can not run since it refused by java verification.
error message:
I have been already check the java file version and the byte code, but not found any suspicious.
It's a very small class file:
before soot:
after soot:
test java file:
My java version:
the problem is that JVM check the class file in each entry separately, in this test case,
12: astore_0
as an entry, but local[3] not initialized.Maybe it can add a transform to check this situation or fix Jimple in jtp process to solve it.
The text was updated successfully, but these errors were encountered: