<div dir="ltr">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.<div><br></div><div>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.</div><div><br></div><div>Thanks,</div><div>Dan</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 13, 2019 at 5:14 AM Manuel Benz <<a href="mailto:manuel.benz@uni-paderborn.de">manuel.benz@uni-paderborn.de</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 style="overflow-wrap: break-word;">
<span style="color:rgb(0,0,0)">Can you please check if version 3.3.1-SNAPSHOT solves your problem?</span>
<div style="color:rgb(0,0,0)"><br>
</div>
<div style="color:rgb(0,0,0)">You have to include Maven Central’s snapshot repository to acquire that version:</div>
<div style="color:rgb(0,0,0)"><br>
</div>
<div style="color:rgb(0,0,0)">
<pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:13.6px;margin-bottom:0px;margin-top:0px;background-color:rgb(246,248,250);border-radius:3px;line-height:1.45;overflow:auto;padding:16px;word-break:normal;color:rgb(36,41,46);font-variant-ligatures:normal"><<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">dependencies</span>>
  <<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">dependency</span>>
    <<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">groupId</span>>ca.mcgill.sable</<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">groupId</span>>
    <<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">artifactId</span>>soot</<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">artifactId</span>>
    <<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">version</span>>3.3.1-SNAPSHOT</<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">version</span>>
  </<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">dependency</span>>
</<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">dependencies</span>>
<<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">repositories</span>>
  <<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">repository</span>>
      <<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">id</span>>sonatype-snapshots</<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">id</span>>
      <<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">url</span>><a href="https://oss.sonatype.org/content/repositories/snapshots" target="_blank">https://oss.sonatype.org/content/repositories/snapshots</a></<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">url</span>>
      <<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">releases</span>>
          <<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">enabled</span>>false</<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">enabled</span>>
      </<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">releases</span>>
  </<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">repository</span>>
</<span class="gmail-m_-4307757179371560819pl-ent" style="box-sizing:border-box;color:rgb(34,134,58)">repositories</span></pre>
</div>
<div><br>
</div>
<div><br>
<blockquote type="cite">
<div>Am 13.06.2019 um 01:17 schrieb Daniel Peebles <<a href="mailto:pumpkingod@gmail.com" target="_blank">pumpkingod@gmail.com</a>>:</div>
<br class="gmail-m_-4307757179371560819Apple-interchange-newline">
<div>
<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" target="_blank">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">
Dan,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">
>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">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">
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">
<a href="https://github.com/Sable/soot/pull/1078" id="gmail-m_-4307757179371560819gmail-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">
<a href="https://github.com/Sable/soot/pull/1090" id="gmail-m_-4307757179371560819gmail-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">
<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">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">
Best,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">
David</div>
<div id="gmail-m_-4307757179371560819gmail-m_1162042272601806350appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-4307757179371560819gmail-m_1162042272601806350divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt"><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_-4307757179371560819gmail-m_1162042272601806350BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="gmail-m_-4307757179371560819gmail-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>
_______________________________________________<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>
</blockquote>
</div>
<br>
</div>

_______________________________________________<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" rel="noreferrer" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><br>
</blockquote></div>