[Soot-list] java.lang.VerifyError

左小强 xiaoqiang861025 at yahoo.cn
Fri Sep 7 02:15:12 EDT 2012


Hi all,
Thanks so much for your reply.
Attachment is the instrumented class file, Jimple file and tracer file assisting in running the instrumented class.
Note that I success in instrumenting the class file. However when i run the instrumented file, the error is thrown.

Zhiqiang

--- 12年9月7日,周五, Bruno Dufour <dufour at iro.umontreal.ca> 写道:

发件人: Bruno Dufour <dufour at iro.umontreal.ca>
主题: Re: [Soot-list] java.lang.VerifyError
收件人: soot-list at sable.mcgill.ca
抄送: "左小强" <xiaoqiang861025 at yahoo.cn>
日期: 2012年9月7日,周五,上午3:08

On 2012-09-06, at 1:11 PM, Richard Xiao <richardxx at cse.ust.hk> wrote:

> What I mean is that in a constructor function, for example, foo1(), suppose its super class is foo2(), then the first statement in foo1() must be foo2(). If you place anything before calling foo2(), you get verify error. This is a common cause of verify error.

This is not quite true. It is forbidden to access instance members before calling the super constructor (except for initialization, which may occur before the super call). However, the call itself doesn't have to appear first in the bytecode (for source code though, you're right, super(...) must be the first statement). This allows bytecode to be generated for code like 'super(foo(), bar())', where foo and bar must be static of course.

> 
> As Cheng Zhang said, the incompatible of Object and Value does not incur any verify error, you will get runtime error, maybe, instead.
> 
> Check the Java specifications and look at your instrumentation code, see if you did not comfort to the specifications.

Zhiqiang, if you send us the problematic class file (bytecode), I can take a look at it to see if I can spot the problem.

Bruno

> 
> 
> Regards,
> richardxx
>  
> 
> On Thu, Sep 6, 2012 at 3:31 PM, 左小强 <xiaoqiang861025 at yahoo.cn> wrote:
> Hi Richard,
> 
> Thanks for your reply. But I can't understand what you mean. Can you explain your point further?
> 
> Actually I think the problem is that here I use java.lang.Object as the parameter type. I doubt whether it's not compitable with the Jimple Value type.
> 
> anyway, thank you.
> 
> 
> Zhiqiang
> 
> --- 12年9月5日,周三, Richard Xiao <richardxx at cse.ust.hk> 写道:
> 
> 发件人: Richard Xiao <richardxx at cse.ust.hk>
> 主题: Re: [Soot-list] java.lang.VerifyError
> 收件人: "左小强" <xiaoqiang861025 at yahoo.cn>
> 抄送: "soot" <soot-list at sable.mcgill.ca>
> 日期: 2012年9月5日,周三,下午2:13
> 
> 
> Your insertion violates some Java specifications. For example, in a constructor function, the call the super constructor must be the first statement. However, you place your instrumentation at the first position, hence it invalidates the verifier.
> 
> best,
> richardxx
> 
> 
> On Wed, Sep 5, 2012 at 1:11 PM, 左小强 <xiaoqiang861025 at yahoo.cn> wrote:
> Hi all,
> 
> I tried to obtain the runtime value of the operand in ConditionExpr (IfStmt). Therefore I use Soot to instrument the class file.
> 
> I intend to insert the following function into the class file:
> 
>    public static void appendConExpr(java.lang.Object op1)
> 
> using the following statements:
> 
>    InvokeExpr conditionExpr = Jimple.v().newStaticInvokeExpr(
>             traceAppendConExpr.makeRef(), 
>                         ((BinopExpr) ((IfStmt) stmt).getCondition()).getOp1());
>   Stmt conditionStmt = Jimple.v().newInvokeStmt(conditionExpr);
>   units.insertBefore(conditionStmt, stmt);
> 
> The instrumentation phase is OK, however when i run the instrumented program, the Exception "java.lang.VerifyError" is thrown.
> 
> Can anyone tell me the reason and how to fix it? Thanks in advance!
> 
> 
> Zhiqiang
>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20120907/0a035f74/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.class
Type: application/octet-stream
Size: 913 bytes
Desc: not available
Url : http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20120907/0a035f74/attachment-0002.class 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.jimple
Type: application/octet-stream
Size: 2202 bytes
Desc: not available
Url : http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20120907/0a035f74/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DynamicAnalysisUsedTracer.class
Type: application/octet-stream
Size: 2965 bytes
Desc: not available
Url : http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20120907/0a035f74/attachment-0003.class 


More information about the Soot-list mailing list