[Soot-list] Current state of invokedynamic support in soot

Daniel Peebles pumpkingod at gmail.com
Thu Jun 13 08:12:02 EDT 2019


Unfortunately 3.3.1-SNAPSHOT didn't seem to make a difference, and produces
the exact same stack trace on the same problematic method/class. I have
noticed that since the stack trace mentions LineNumberAdder, if I take out
my call to Options.v().set_keep_line_number(true), it no longer fails on
that particular class (and fails in a different spot that's likely my
fault). Not sure if that's just because it no longer looks at it, or
because the bug results from something the LineNumberAdder itself needs to
do, but I figured I'd mention it.

If that isn't enough information to go on, I'll still try to figure out a
sensible reduction for the problem, but haven't had much time recently to
play with soot so it probably won't be for a few days.

Thanks,
Dan

On Thu, Jun 13, 2019 at 5:14 AM Manuel Benz <manuel.benz at uni-paderborn.de>
wrote:

> Can you please check if version 3.3.1-SNAPSHOT solves your problem?
>
> You have to include Maven Central’s snapshot repository to acquire that
> version:
>
> <dependencies>
>   <dependency>
>     <groupId>ca.mcgill.sable</groupId>
>     <artifactId>soot</artifactId>
>     <version>3.3.1-SNAPSHOT</version>
>   </dependency>
> </dependencies>
> <repositories>
>   <repository>
>       <id>sonatype-snapshots</id>
>       <url>https://oss.sonatype.org/content/repositories/snapshots</url>
>       <releases>
>           <enabled>false</enabled>
>       </releases>
>   </repository>
> </repositories
>
>
>
> Am 13.06.2019 um 01:17 schrieb Daniel Peebles <pumpkingod at gmail.com>:
>
> [Sorry, I accidentally didn't reply to all before but I'm running 3.3.0]
>
> I've been unable to construct a minimal repro of the issue, but here's the
> stack trace I get out of soot on my class. Does this help clarify where
> things are going wrong?
>
> java.lang.RuntimeException: Failed to convert <com.blah.MyClass
> java.util.function.Function foo(com.blah.SomeClass)>
> at soot.asm.AsmMethodSource.getBody(AsmMethodSource.java:2040)
> at soot.SootMethod.retrieveActiveBody(SootMethod.java:402)
> at
> soot.jimple.toolkits.annotation.LineNumberAdder.internalTransform(LineNumberAdder.java:64)
> at soot.PackManager.runPacksNormally(PackManager.java:491)
> at soot.PackManager.runPacks(PackManager.java:419)
> at soot.Main.run(Main.java:269)
> at soot.Main.main(Main.java:141)
> at SootTests$.main(SootTests.scala:130)
> at SootTests.main(SootTests.scala)
> Caused by: java.lang.RuntimeException: Trying to create virtual invoke
> expression for interface type (com.blah.MyClass in file null). Use
> JInterfaceInvokeExpr instead!
> at
> soot.jimple.internal.JVirtualInvokeExpr.<init>(JVirtualInvokeExpr.java:49)
> at soot.jimple.Jimple.newVirtualInvokeExpr(Jimple.java:469)
> at
> soot.LambdaMetaFactory$ThunkMethodSource._invokeImplMethod(LambdaMetaFactory.java:699)
> at
> soot.LambdaMetaFactory$ThunkMethodSource.invokeImplMethod(LambdaMetaFactory.java:646)
> at
> soot.LambdaMetaFactory$ThunkMethodSource.getInvokeBody(LambdaMetaFactory.java:483)
> at
> soot.LambdaMetaFactory$ThunkMethodSource.getBody(LambdaMetaFactory.java:334)
> at soot.SootMethod.retrieveActiveBody(SootMethod.java:402)
> at soot.LambdaMetaFactory.makeLambdaHelper(LambdaMetaFactory.java:239)
> at
> soot.asm.AsmMethodSource.convertInvokeDynamicInsn(AsmMethodSource.java:1420)
> at soot.asm.AsmMethodSource.convert(AsmMethodSource.java:1791)
> at soot.asm.AsmMethodSource.getBody(AsmMethodSource.java:2038)
> ... 8 more
>
>
> On Wed, Jun 12, 2019 at 10:46 AM David Diepenbrock <
> ddiepenbrock at pjrcorp.com> wrote:
>
>> Dan,
>>
>> From my experience the latest 3.3.0 release has several commits that
>> improve soot's ability to process lambdas.  If you're on an older release
>> give upgrading a try.  I can tell you that 3.3.0 vs. 3.1.0 I see
>> functionality that otherwise was broken after processing now works as
>> expected.
>>
>> Here's some of the changes in 3.3.0 that I tracked down when I was
>> working soot processing with lambdas recently:
>> https://github.com/Sable/soot/pull/1078
>> https://github.com/Sable/soot/pull/1090
>>
>> If you're already on 3.3.0 or newer then I'll have to punt.
>>
>> Best,
>> David
>> ------------------------------
>> *From:* Soot-list <soot-list-bounces at CS.McGill.CA> on behalf of Daniel
>> Peebles <pumpkingod at gmail.com>
>> *Sent:* Wednesday, June 12, 2019 9:28 AM
>> *To:* soot-list at cs.mcgill.ca
>> *Subject:* [Soot-list] Current state of invokedynamic support in soot
>>
>> Hi all,
>>
>> I’m running soot on a jar and it’s barfing with an error saying “Failed
>> to convert” on a method that returns a java.util.function.Function from a
>> lambda expression. The bytecode involves invokedynamic and I’m wondering if
>> soot has trouble on that sort of code, and if so, what a good approach to
>> dealing with it is.
>>
>> Unfortunately I can’t share the code in question but might be able to
>> reduce it later if it helps or if this behavior is unexpected.
>>
>> Thanks,
>> Dan
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at CS.McGill.CA
>> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>> <https://mailman.cs.mcgill.ca/mailman/listinfo/soot-list>
>>
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20190613/eb7d3c95/attachment.html>


More information about the Soot-list mailing list