Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error: java.lang.VerifyError: Constructor must call super() or this() before return #15835

Closed
ghost opened this issue Aug 8, 2022 · 5 comments · Fixed by #16235
Closed
Assignees
Labels
area:coverage Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html itype:bug itype:crash stat:needs minimization Needs a self contained minimization
Milestone

Comments

@ghost
Copy link

ghost commented Aug 8, 2022

Compiler version

3.2.0-RC1

It was working on version 3.1.3

Minimized code

package json.value.spec.parser

import java.math.MathContext
import com.github.plokhotnyuk.jsoniter_scala.core.JsonReader
case class DecimalConf(mathContext: MathContext, scaleLimit: Int, digitsLimit: Int)


object DecimalConf extends DecimalConf(MathContext.UNLIMITED, 6178, 308)

link to reproducer

You can download the repo (branch v5.0.0) and execute

sbt compile test

Output (click arrow to expand)

[error] java.lang.VerifyError: Constructor must call super() or this() before return
[error] Exception Details:
[error]   Location:
[error]     json/value/spec/parser/DecimalConf$.<init>()V @0: return
[error]   Reason:
[error]     Error exists in the bytecode
[error]   Bytecode:
[error]     0000000: b1                                     
[error] 
[error]         at json.value.spec.parser.JsObjParser$.<clinit>(Parser.scala:130)
[error]         at json.value.JsObj$.<clinit>(JsValue.scala:789)
[error]         at json.value.gen.JsObjGen$.apply(JsObjGen.scala:26)
[error]         at tests.JsObjSpecProperties$.<clinit>(JsObjSpecProperties.scala:21)
[error]         at java.base/java.lang.Class.forName0(Native Method)
[error]         at java.base/java.lang.Class.forName(Class.java:467)
[error]         at org.scalacheck.Platform$.loadModule(Platform.scala:69)
[error]         at org.scalacheck.ScalaCheckRunner$BaseTask.<init>(ScalaCheckFramework.scala:55)
[error]         at org.scalacheck.ScalaCheckRunner$$anon$2.<init>(ScalaCheckFramework.scala:93)
[error]         at org.scalacheck.ScalaCheckRunner.rootTask(ScalaCheckFramework.scala:93)
[error]         at org.scalacheck.ScalaCheckRunner.$anonfun$tasks$2(ScalaCheckFramework.scala:44)
[error]         at scala.collection.ArrayOps$.map$extension(ArrayOps.scala:929)
[error]         at org.scalacheck.ScalaCheckRunner.tasks(ScalaCheckFramework.scala:44)
[error]         at sbt.TestRunner.tasks(TestFramework.scala:114)
[error]         at sbt.TestFramework$.$anonfun$createTestTasks$4(TestFramework.scala:275)
[error]         at sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:289)
[error]         at sbt.TestFramework$.$anonfun$createTestTasks$3(TestFramework.scala:275)
[error]         at sbt.TestFramework$.$anonfun$createTestTasks$3$adapted(TestFramework.scala:272)
[error]         at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:293)
[error]         at scala.collection.Iterator.foreach(Iterator.scala:943)
[error]         at scala.collection.Iterator.foreach$(Iterator.scala:943)
[error]         at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
[error]         at scala.collection.IterableLike.foreach(IterableLike.scala:74)
[error]         at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
[error]         at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
[error]         at scala.collection.TraversableLike.flatMap(TraversableLike.scala:293)
[error]         at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:290)
[error]         at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
[error]         at sbt.TestFramework$.createTestTasks(TestFramework.scala:272)
[error]         at sbt.TestFramework$.testTasks(TestFramework.scala:225)
[error]         at sbt.Tests$.testTask(Tests.scala:357)
[error]         at sbt.Tests$.apply(Tests.scala:324)
[error]         at sbt.Defaults$.$anonfun$allTestGroupsTask$6(Defaults.scala:1572)
[error]         at scala.collection.immutable.List.map(List.scala:293)
[error]         at sbt.Defaults$.allTestGroupsTask(Defaults.scala:1547)
[error]         at sbt.Defaults$.$anonfun$testTasks$10(Defaults.scala:1253)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]         at sbt.Execute.work(Execute.scala:291)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error]         at java.base/java.lang.Thread.run(Thread.java:833)
@ghost ghost added itype:bug itype:crash stat:needs triage Every issue needs to have an "area" and "itype" label labels Aug 8, 2022
@sergewar
Copy link

sergewar commented Aug 9, 2022

Can this bug have the same root cause as scoverage/sbt-scoverage#450 ?

@ghost
Copy link
Author

ghost commented Aug 9, 2022

it seems you are right, I just removed the plugin and it's working fine...

@ckipp01
Copy link
Member

ckipp01 commented Aug 9, 2022

To clarify a bit, you can also reproduce this without using sbt-scoverage. In your example repo just remove sbt-scoverage, add -coverage-out:foo to your scalacOptions and run test. You'll get the same issue. Just wanted to show that this isn't due to the integration or to scoverage, but rather the instrumentation here.

@ghost
Copy link
Author

ghost commented Aug 9, 2022

@ckipp01 you are right, just did as you say and the same error happens without including the sbt-scoverage plugin

@KacperFKorban KacperFKorban added stat:needs minimization Needs a self contained minimization area:coverage Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Aug 9, 2022
@sergewar
Copy link

sergewar commented Aug 9, 2022

Also confirm that on my project have this error with option -coverage-out:foo

@TheElectronWill TheElectronWill self-assigned this Sep 28, 2022
TheElectronWill added a commit to TheElectronWill/dotty that referenced this issue Oct 23, 2022
@TheElectronWill TheElectronWill linked a pull request Oct 23, 2022 that will close this issue
TheElectronWill added a commit to TheElectronWill/dotty that referenced this issue Oct 23, 2022
TheElectronWill added a commit to TheElectronWill/dotty that referenced this issue Oct 24, 2022
@Kordyjan Kordyjan added this to the 3.2.2 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:coverage Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html itype:bug itype:crash stat:needs minimization Needs a self contained minimization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants