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

Manuel Benz manuel.benz at uni-paderborn.de
Thu Jun 13 05:14:00 EDT 2019


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<mailto: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<mailto: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<mailto:soot-list-bounces at CS.McGill.CA>> on behalf of Daniel Peebles <pumpkingod at gmail.com<mailto:pumpkingod at gmail.com>>
Sent: Wednesday, June 12, 2019 9:28 AM
To: soot-list at cs.mcgill.ca<mailto: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<mailto: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<mailto: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/4f6b0267/attachment-0001.html>


More information about the Soot-list mailing list