<div dir="ltr"><div>[Sorry, I accidentally didn't reply to all before but I'm running 3.3.0]</div><div><br></div>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?<div><br></div><div>java.lang.RuntimeException: Failed to convert <com.blah.MyClass java.util.function.Function foo(com.blah.SomeClass)><br>       at soot.asm.AsmMethodSource.getBody(AsmMethodSource.java:2040)<br>        at soot.SootMethod.retrieveActiveBody(SootMethod.java:402)<br>    at soot.jimple.toolkits.annotation.LineNumberAdder.internalTransform(LineNumberAdder.java:64)<br> at soot.PackManager.runPacksNormally(PackManager.java:491)<br>    at soot.PackManager.runPacks(PackManager.java:419)<br>    at soot.Main.run(Main.java:269)<br>       at soot.Main.main(Main.java:141)<br>      at SootTests$.main(SootTests.scala:130)<br>       at SootTests.main(SootTests.scala)<br>Caused by: java.lang.RuntimeException: Trying to create virtual invoke expression for interface type (com.blah.MyClass in file null). Use JInterfaceInvokeExpr instead!<br>  at soot.jimple.internal.JVirtualInvokeExpr.<init>(JVirtualInvokeExpr.java:49)<br>   at soot.jimple.Jimple.newVirtualInvokeExpr(Jimple.java:469)<br>   at soot.LambdaMetaFactory$ThunkMethodSource._invokeImplMethod(LambdaMetaFactory.java:699)<br>     at soot.LambdaMetaFactory$ThunkMethodSource.invokeImplMethod(LambdaMetaFactory.java:646)<br>      at soot.LambdaMetaFactory$ThunkMethodSource.getInvokeBody(LambdaMetaFactory.java:483)<br> at soot.LambdaMetaFactory$ThunkMethodSource.getBody(LambdaMetaFactory.java:334)<br>       at soot.SootMethod.retrieveActiveBody(SootMethod.java:402)<br>    at soot.LambdaMetaFactory.makeLambdaHelper(LambdaMetaFactory.java:239)<br>        at soot.asm.AsmMethodSource.convertInvokeDynamicInsn(AsmMethodSource.java:1420)<br>       at soot.asm.AsmMethodSource.convert(AsmMethodSource.java:1791)<br>        at soot.asm.AsmMethodSource.getBody(AsmMethodSource.java:2038)<br>        ... 8 more<br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 12, 2019 at 10:46 AM David Diepenbrock <<a href="mailto:ddiepenbrock@pjrcorp.com">ddiepenbrock@pjrcorp.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Dan,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
>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.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Here's some of the changes in 3.3.0 that I tracked down when I was working soot processing with lambdas recently:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<a href="https://github.com/Sable/soot/pull/1078" id="gmail-m_1162042272601806350LPlnk258334" target="_blank">https://github.com/Sable/soot/pull/1078</a><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<a href="https://github.com/Sable/soot/pull/1090" id="gmail-m_1162042272601806350LPNoLP934649" target="_blank">https://github.com/Sable/soot/pull/1090</a><br>
</div>
<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;background-color:rgb(255,255,255);display:inline">If you're already on 3.3.0 or newer then I'll have to punt.</span><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Best,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
David</div>
<div id="gmail-m_1162042272601806350appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_1162042272601806350divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Soot-list <<a href="mailto:soot-list-bounces@CS.McGill.CA" target="_blank">soot-list-bounces@CS.McGill.CA</a>> on behalf of Daniel Peebles <<a href="mailto:pumpkingod@gmail.com" target="_blank">pumpkingod@gmail.com</a>><br>
<b>Sent:</b> Wednesday, June 12, 2019 9:28 AM<br>
<b>To:</b> <a href="mailto:soot-list@cs.mcgill.ca" target="_blank">soot-list@cs.mcgill.ca</a><br>
<b>Subject:</b> [Soot-list] Current state of invokedynamic support in soot</font>
<div> </div>
</div>
<div class="gmail-m_1162042272601806350BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="gmail-m_1162042272601806350PlainText">Hi all,<br>
<br>
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.<br>
<br>
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.<br>
<br>
Thanks,<br>
Dan<br>
_______________________________________________<br>
Soot-list mailing list<br>
<a href="mailto:Soot-list@CS.McGill.CA" target="_blank">Soot-list@CS.McGill.CA</a><br>
<a href="https://mailman.CS.McGill.CA/mailman/listinfo/soot-list" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><br>
</div>
</span></font></div>
</div>

</blockquote></div>