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

Daniel Peebles pumpkingod at gmail.com
Wed Jun 12 19:17:54 EDT 2019


[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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20190612/f728abbd/attachment.html>


More information about the Soot-list mailing list