You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Assertion failure in isAnonymousOrLocalClass #8900
When using the 2.11.3 version that is currently on Maven Central or the most recent SNAPSHOT, I get an assertion failure when compiling the latest development version of our Kiama library. The build log is in the attached file, but the stack trace starts:
at scala.tools.nsc.backend.jvm.BCodeAsmCommon.isAnonymousOrLocalClass(BCodeAsmCommon.scala:35)
at scala.tools.nsc.backend.jvm.GenASM$JBuilder.scala$tools$nsc$backend$jvm$GenASM$JBuilder$$outerName$1(GenASM.scala:686)
at scala.tools.nsc.backend.jvm.GenASM$JBuilder.addInnerClasses(GenASM.scala:722)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genClass(GenASM.scala:1341)
at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.emitFor$1(GenASM.scala:197)
at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.run(GenASM.scala:203)
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1338)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1325)
@retronym said: @lrytz We're getting a false positive from isDelambdafyFunction. The symbol name in question is LambdaTests$$anonfun$org$kiama$example$lambda2$LambdaTests$$canons$1$1. I don't have a smaller reproduction yet.
@lrytz said:
Hi @retronym, [~asloane]. The failing file is library/src/org/kiama/example/lambda2/LambdaTests.scala. As a reduced version, replace the content of the file by the follwing, it triggers the same error.
The fishy thing is that Strategy.+ is a macro, and I could not reproduce the failure without the macro call. So it's possible that the assertion doesn't fail on compiler-generated code.
However, the implementation of isDelambdafyFunction (as well as isAnonymousFunction) is not robust at all against false positives:
So an assert(!sym.isDelambdafyFunction) is unsafe. I think for now we should just remove the assertion, longer term there should be a better implementation of the above.
@gkossakowski said:
Tony, would you be interested in adding Kiama 1.7.0 to the community build that we use to test Scala compiler? Given that you guys found a regression that none of 77 projects that are already there caught, it would be great to welcome you to the family!
@gkossakowski said:
Tony, I was wondering if you could help with adding Kiama to community build. Adding a project to community build very often requires understanding of project's build so it's best done by project maintainers. Also, we are trying to spread the effort amongst community members so we can Scale the whole process to 100+ projects.
In the case of Scala.js, I can tell you that it's not generated by a macro, because there's no macro in the Scala.js repository. The failing project is the test suite, which is not compiled with -Ydelambdafy:method. There is however, on the classpath of that compilation, another project which is compiled with -Ydelambdafy:method (the test-bridge).
Tony Sloane (asloane) said:
Grzegorz, on the community build question, it appears that only git and svn are supported by dbuild at the moment. This limits what I can do since Kiama is in a Mercurial repository. I've added a ticket over at the dbuild tracker to flag this issue:
@gkossakowski said (edited on Oct 20, 2014 12:50:21 PM UTC):
Oh, it's a bummer we can't add Kiama to community build right away! Thanks for opening an issue against dbuild so we have that limitation documented. I hope dbuild can learn how to read Mercurial repos at some point.
Here's link to PR that fixes the original issue reported in this ticket: scala/scala#4049
Activity
scabug commentedon Oct 12, 2014
Imported From: https://issues.scala-lang.org/browse/SI-8900?orig=1
Reporter: Tony Sloane (asloane)
Affected Versions: 2.11.3
Attachments:
scabug commentedon Oct 12, 2014
Tony Sloane (asloane) said:
Forgot to say explicitly that the relevant version is the latest in this repo:
The log mentions
org.kiama.example.lambda2.LambdaTreeso I presume the crash is triggered there somewhere, but I haven't narrowed it down yet.scabug commentedon Oct 12, 2014
Tony Sloane (asloane) said:
The relevant commit seems to be
scala/scala@63207e1
scabug commentedon Oct 12, 2014
@retronym said:
@lrytz We're getting a false positive from
isDelambdafyFunction. The symbol name in question isLambdaTests$$anonfun$org$kiama$example$lambda2$LambdaTests$$canons$1$1. I don't have a smaller reproduction yet.scabug commentedon Oct 12, 2014
@gkossakowski said:
Tony, can this issue be reproduced with released version of Kiama?
scabug commentedon Oct 12, 2014
@Sciss said:
Are the labels correct? It says affects 2.10.3 / fixed 2.10.4. Should it be 2.11.3?
scabug commentedon Oct 12, 2014
@lrytz said:
Hi @retronym, [~asloane]. The failing file is
library/src/org/kiama/example/lambda2/LambdaTests.scala. As a reduced version, replace the content of the file by the follwing, it triggers the same error.The fishy thing is that
Strategy.+is a macro, and I could not reproduce the failure without the macro call. So it's possible that the assertion doesn't fail on compiler-generated code.However, the implementation of
isDelambdafyFunction(as well asisAnonymousFunction) is not robust at all against false positives:So an
assert(!sym.isDelambdafyFunction)is unsafe. I think for now we should just remove the assertion, longer term there should be a better implementation of the above.scabug commentedon Oct 12, 2014
@lrytz said:
scala/scala#4049
scabug commentedon Oct 12, 2014
Tony Sloane (asloane) said:
Grzegorz: yes, the same problem occurs with Kiama 1.7.0 which is the most recent release.
scabug commentedon Oct 12, 2014
@gkossakowski said:
Tony, would you be interested in adding Kiama 1.7.0 to the community build that we use to test Scala compiler? Given that you guys found a regression that none of 77 projects that are already there caught, it would be great to welcome you to the family!
scabug commentedon Oct 12, 2014
Tony Sloane (asloane) said:
Grzegorz, yes, no objections from me if you want to include Kiama in the community build. Is there anything I need to do?
scabug commentedon Oct 13, 2014
@gkossakowski said:
Tony, I was wondering if you could help with adding Kiama to community build. Adding a project to community build very often requires understanding of project's build so it's best done by project maintainers. Also, we are trying to spread the effort amongst community members so we can Scale the whole process to 100+ projects.
scabug commentedon Oct 13, 2014
@sjrd said:
This is also hit in Scala.js (see scala-js/scala-js#1147).
In the case of Scala.js, I can tell you that it's not generated by a macro, because there's no macro in the Scala.js repository. The failing project is the test suite, which is not compiled with
-Ydelambdafy:method. There is however, on the classpath of that compilation, another project which is compiled with-Ydelambdafy:method(the test-bridge).scabug commentedon Oct 13, 2014
Tony Sloane (asloane) said:
Grzegorz, ok, I'll look into adding Kiama to the community build. Shouldn't be a problem.
scabug commentedon Oct 20, 2014
Tony Sloane (asloane) said:
Grzegorz, on the community build question, it appears that only git and svn are supported by dbuild at the moment. This limits what I can do since Kiama is in a Mercurial repository. I've added a ticket over at the dbuild tracker to flag this issue:
scala-garden/dbuild#146.
scabug commentedon Oct 20, 2014
@gkossakowski said (edited on Oct 20, 2014 12:50:21 PM UTC):
Oh, it's a bummer we can't add Kiama to community build right away! Thanks for opening an issue against dbuild so we have that limitation documented. I hope dbuild can learn how to read Mercurial repos at some point.
Here's link to PR that fixes the original issue reported in this ticket: scala/scala#4049