[Soot-list] Invalid bytecode after processing with soot (java.lang.VerifyError for invokespecial)

Eric Bodden eric.bodden at ec-spride.de
Fri Feb 24 10:34:50 EST 2012


Christina.

Dava output is not helping because it's too far away from the bytecode
that will be generated. As I wrote, we would need Jimple or Jasmin
output to see what the problem really is.

Eric

On 24 February 2012 16:23, Cristina Ilie <crysgirlro at yahoo.com> wrote:
> As I said when I set the type of output to Dava for my tool, the function is
> ok (actually is a very simple example).
> The problem is only when I set the output as .class. My Jimple output for
> this example is: (this is the output function
> my tool gives; actually it works on "compute" function [2] and outputs
> this): [1]
>
> The problem is with the "clone" function; if I have for example only the
> statement "z=2" in "compute function
> then all is ok also if I set the output as .class. The problem is with the
> special invoke "clone" and I don't know
> why, because when I output Dava code the function g_compute works fine. So
> something happens at
> bytecode level with respect to this invoke. (DerivType it's a new type
> introduced by my tool - it's ok)
>
> Cristina
>
> [1]
> public static DerivType g_compute(DerivType)
>     {
>         DerivType x, z;
>         int adindex;
>         double[] g_tmp_0;
>
>         x := @parameter0: DerivType;
>         z = new DerivType;
>         specialinvoke z.<DerivType: void <init>()>();
>         g_tmp_0 = x.<DerivType: double[] grad>;
>         z.<DerivType: double[] grad> = (double[]) specialinvoke
> g_tmp_0.<java.lang.Object: java.lang.Object clone()>();
>         z.<DerivType: double value> = x.<DerivType: double value> + 2.0;
>         return z;
>     }
>
> [2]
> public static double compute (double x){
>         double z;
>         z = x+2;
>         return z;
>     }
>
> Cristina
> ________________________________
> From: Eric Bodden <eric.bodden at ec-spride.de>
> To: Cristina Ilie <crysgirlro at yahoo.com>
> Cc: Soot-list <soot-list at sable.mcgill.ca>
> Sent: Friday, February 24, 2012 3:30 PM
> Subject: Re: [Soot-list] Invalid bytecode after processing with soot
> (java.lang.VerifyError for invokespecial)
>
> Hi Christina.
>
> Apparently, the code you generate is incorrect. There could be 1000
> reasons for this and it is impossible to tell without knowing the
> generated code.
>
> Did you try the -validate flag to Soot?
> Another good idea is to generate Jimple and/or jasmin versions using
> the "-f J" or "-f jasmin" flags. If you send us such versions of your
> FMTest class then maybe we can help.
>
> Eric
>
> On 24 February 2012 13:36, Cristina Ilie <crysgirlro at yahoo.com> wrote:
>> Hello,
>>
>> My tool (which uses Soot) has a problem with source files which contain
>> "special invokes" when I'm generating .class.
>> When I set the output to Dava type all is ok. My output source file works
>> fine. But when I apply my tool to the same
>> code example and I set the output as .class file I have the following
>> problem: [1]. This is obvious that is from the
>> special invoke call... I tried to take a look to the bytecode but I can't
>> figure out... I read on some forums that similar
>> problems were encountered when some optimizations tools made some
>> annotations to the code and altered the
>> bytecode making it invalid. I suppose here it's something similar... What
>> to
>> disable from soot to be sure that the bytecode
>> is not altered? Or do you think the problem is elsewhere?
>>
>> [1] Exception in thread "main" java.lang.VerifyError: (class: AppSource,
>> method: g_compute signature: (LDerivType;)LDerivType;)
>> Incompatible object argument for invokespecial at
>> FMTest.main(FMTest.java:23)
>>
>> Cristina
>>
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at sable.mcgill.ca
>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>
>
>
>
> --
> Eric Bodden, Ph.D., http://bodden.de/
> Head of Secure Software Engineering Group at EC SPRIDE
> Principal Investigator in Secure Services at CASED
> Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
>
>



-- 
Eric Bodden, Ph.D., http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Principal Investigator in Secure Services at CASED
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list