[Soot-list] java.lang.VerifyError and byte code execution trace

Yongzhi Wang wang.yongzhi2009 at gmail.com
Thu Sep 12 21:27:25 EDT 2013


Dear All,

I am stucked by the byte code that I generate with soot. I am using soot to
transform the control flow of java class. The transformed program should
behave same as the original program. However, my generated class file
cannot be executed  without the "-noverify" option.

If I run the class file in java without "-noverify" option, I got the
following error message:
java.lang.VerifyError: (class: Test, method: main signature:
([Ljava/lang/String;)V) Register 3 contains wrong type

If I run the class file in java with "-noverify" option, some test program
will run correctly. But some test programs will be pending. I suspect the
program is in a dead loop given my transformed control flow.

My question is:

1. What is the usual reason of "Register contains wrong type" error? I can
observe that my transformed class file has instruction aload_3 appears
before astore_3, even though I use goto instruction to control the control
flow to make sure astore_3 is executed before aloud_3. Is that the reason?
If so, what's the trick to fix this problem?

2. I suspect the test program is in a dead loop. How can I trace the
bytecode instruction execution sequence from JVM? Is there any tool or JVM
option I can use?

Thanks!
Best regards,
Yongzhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130912/26c6575d/attachment.html 


More information about the Soot-list mailing list