scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

Compiler deadlock in `scalac-jvm-non-ast-*` threads #12978

Closed durban closed 7 months ago

durban commented 8 months ago

Reproduction steps

Scala version: 2.13.13

Sometimes when compiling, the compiler seems to deadlock.

Unfortunately I have no idea how to reproduce. Sometimes I see it in CI logs. One example is here: https://github.com/durban/choam/actions/runs/8499930606/job/23281252612#step:24:1120. If I see it again, I'll try to add more links.

The relevant part copied from the log above:

Found one Java-level deadlock:
=============================
"pool-8-thread-4":
  waiting to lock monitor 0x00000231c154a200 (object 0x00000006c94938f8, a java.lang.Object),
  which is held by "scalac-jvm-non-ast-1"

"scalac-jvm-non-ast-1":
  waiting to lock monitor 0x00000231c1548b40 (object 0x00000006c9527430, a java.util.Collections$SynchronizedMap),
  which is held by "scalac-jvm-non-ast-3"

"scalac-jvm-non-ast-3":
  waiting to lock monitor 0x00000231c154a200 (object 0x00000006c94938f8, a java.lang.Object),
  which is held by "scalac-jvm-non-ast-1"
Stacktrace for these 3 threads: ``` Java stack information for the threads listed above: =================================================== "pool-8-thread-4": at scala.tools.nsc.backend.jvm.BTypes$LazyVar.get(BTypes.scala:1096) - waiting to lock <0x00000006c94938f8> (a java.lang.Object) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols.lambdaDeserializeBootstrapHandle(CoreBTypes.scala:407) at scala.tools.nsc.backend.jvm.analysis.BackendUtils.emitLambdaDeserializeIndy$1(BackendUtils.scala:134) at scala.tools.nsc.backend.jvm.analysis.BackendUtils.addLambdaDeserialize(BackendUtils.scala:155) at scala.tools.nsc.backend.jvm.PostProcessor.sendToDisk(PostProcessor.scala:68) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$3(GeneratedClassHandler.scala:131) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$2(GeneratedClassHandler.scala:131) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x00000231828665d8.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.tools.nsc.backend.jvm.PostProcessorFrontendAccess$PostProcessorFrontendAccessImpl.withThreadLocalReporter(PostProcessorFrontendAccess.scala:242) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$1(GeneratedClassHandler.scala:130) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x00000231828643c8.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:687) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x00000231828649a8.apply(Unknown Source) at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467) at java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy.rejectedExecution(java.base@21.0.2/ThreadPoolExecutor.java:2053) at java.util.concurrent.ThreadPoolExecutor.reject(java.base@21.0.2/ThreadPoolExecutor.java:841) at java.util.concurrent.ThreadPoolExecutor.execute(java.base@21.0.2/ThreadPoolExecutor.java:1376) at scala.concurrent.impl.ExecutionContextImpl.execute(ExecutionContextImpl.scala:21) at scala.concurrent.impl.Promise$Transformation.submitWithValue(Promise.scala:429) at scala.concurrent.impl.Promise$DefaultPromise.submitWithValue(Promise.scala:338) at scala.concurrent.impl.Promise$DefaultPromise.dispatchOrAddCallbacks(Promise.scala:312) at scala.concurrent.impl.Promise$DefaultPromise.map(Promise.scala:182) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.postProcessUnit(GeneratedClassHandler.scala:126) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.process(GeneratedClassHandler.scala:119) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$GlobalOptimisingGeneratedClassHandler.$anonfun$complete$1(GeneratedClassHandler.scala:99) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$GlobalOptimisingGeneratedClassHandler.complete(GeneratedClassHandler.scala:99) at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.$anonfun$run$1(GenBCode.scala:81) at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.run(GenBCode.scala:78) at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1549) at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1533) at scala.tools.nsc.Global$Run.compileSources(Global.scala:1525) at scala.tools.nsc.Global$Run.compileFiles(Global.scala:1638) at scala.tools.xsbt.CachedCompiler0.run(CompilerBridge.scala:176) at scala.tools.xsbt.CachedCompiler0.run(CompilerBridge.scala:139) - locked <0x00000006c94bfa18> (a scala.tools.xsbt.CachedCompiler0) at scala.tools.xsbt.CompilerBridge.run(CompilerBridge.scala:43) at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91) at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:193) at sbt.internal.inc.MixedAnalyzingCompiler$$Lambda/0x0000023181ff4f50.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:248) at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:183) at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:163) at sbt.internal.inc.MixedAnalyzingCompiler$$Lambda/0x0000023181fecbd0.apply(Unknown Source) at sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239) at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:163) at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:211) at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:534) at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:534) at sbt.internal.inc.IncrementalCompilerImpl$$Lambda/0x00000231819cb200.apply(Unknown Source) at sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:180) at sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:178) at sbt.internal.inc.Incremental$$$Lambda/0x00000231819f05f0.apply(Unknown Source) at sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:464) at sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:116) at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56) at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52) at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:263) at sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:419) at sbt.internal.inc.Incremental$$$Lambda/0x0000023181a04fe8.apply(Unknown Source) at sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:506) at sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:406) at sbt.internal.inc.Incremental$.apply(Incremental.scala:172) at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:534) at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:488) at sbt.internal.inc.IncrementalCompilerImpl$$Lambda/0x00000231819c6a90.apply(Unknown Source) at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332) at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:425) at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137) at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2371) at sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2321) at sbt.Defaults$$$Lambda/0x00000231819b88f8.apply(Unknown Source) at sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:31) at sbt.internal.server.BspCompileTask$$$Lambda/0x00000231819c5228.apply(Unknown Source) at sbt.internal.io.Retry$.apply(Retry.scala:47) at sbt.internal.io.Retry$.apply(Retry.scala:29) at sbt.internal.io.Retry$.apply(Retry.scala:24) at sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:31) at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2319) at sbt.Defaults$$$Lambda/0x00000231814c83d0.apply(Unknown Source) at scala.Function1.$anonfun$compose$1(Function1.scala:49) at scala.Function1$$Lambda/0x00000231812d5000.apply(Unknown Source) at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63) at sbt.internal.util.$tilde$greater$$Lambda/0x00000231818497c8.apply(Unknown Source) at sbt.std.Transform$$anon$4.work(Transform.scala:69) at sbt.Execute.$anonfun$submit$2(Execute.scala:283) at sbt.Execute$$Lambda/0x00000231818542e8.apply(Unknown Source) at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24) at sbt.Execute.work(Execute.scala:292) at sbt.Execute.$anonfun$submit$1(Execute.scala:283) at sbt.Execute$$Lambda/0x000002318184c110.apply(Unknown Source) at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265) at sbt.ConcurrentRestrictions$$anon$4$$Lambda/0x000002318184e550.apply(Unknown Source) at sbt.CompletionService$$anon$2.call(CompletionService.scala:65) at java.util.concurrent.FutureTask.run(java.base@21.0.2/FutureTask.java:317) at java.util.concurrent.Executors$RunnableAdapter.call(java.base@21.0.2/Executors.java:572) at java.util.concurrent.FutureTask.run(java.base@21.0.2/FutureTask.java:317) at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@21.0.2/ThreadPoolExecutor.java:1144) at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@21.0.2/ThreadPoolExecutor.java:642) at java.lang.Thread.runWith(java.base@21.0.2/Thread.java:1596) at java.lang.Thread.run(java.base@21.0.2/Thread.java:1583) "scalac-jvm-non-ast-1": at java.util.Collections$SynchronizedMap.computeIfAbsent(java.base@21.0.2/Collections.java:2980) - waiting to lock <0x00000006c9527430> (a java.util.Collections$SynchronizedMap) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.getOrElseUpdate(JavaCollectionWrappers.scala:369) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.getOrElseUpdate$(JavaCollectionWrappers.scala:368) at scala.collection.convert.JavaCollectionWrappers$AbstractJMapWrapper.getOrElseUpdate(JavaCollectionWrappers.scala:344) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.parsedClassNode(ByteCodeRepository.scala:73) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.classNode(ByteCodeRepository.scala:94) at scala.tools.nsc.backend.jvm.BTypesFromSymbols.buildInlineInfo(BTypesFromSymbols.scala:544) at scala.tools.nsc.backend.jvm.BTypesFromSymbols.computeClassInfo(BTypesFromSymbols.scala:456) at scala.tools.nsc.backend.jvm.BTypesFromSymbols.$anonfun$classBTypeFromSymbolInit$1(BTypesFromSymbols.scala:116) at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$Lambda/0x00000231822a5d28.apply(Unknown Source) at scala.tools.nsc.backend.jvm.BTypes$ClassBType$.apply(BTypes.scala:828) - locked <0x00000006c9527810> (a scala.tools.nsc.backend.jvm.BTypes$ClassBTypeFromSymbol) at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:106) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols.$anonfun$_srLambdaDeserialize$1(CoreBTypes.scala:226) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols$$Lambda/0x0000023182d5b578.apply(Unknown Source) at scala.tools.nsc.backend.jvm.BTypes$LazyVar.$anonfun$get$1(BTypes.scala:1097) at scala.tools.nsc.backend.jvm.BTypes$LazyVar.get(BTypes.scala:1096) - locked <0x00000006c94938f8> (a java.lang.Object) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols.srLambdaDeserialize(CoreBTypes.scala:225) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols.$anonfun$_lambdaDeserializeBootstrapHandle$1(CoreBTypes.scala:410) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols$$Lambda/0x0000023182d5b2c0.apply(Unknown Source) at scala.tools.nsc.backend.jvm.BTypes$LazyVar.$anonfun$get$1(BTypes.scala:1097) at scala.tools.nsc.backend.jvm.BTypes$LazyVar.get(BTypes.scala:1096) - locked <0x00000006c94938f8> (a java.lang.Object) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols.lambdaDeserializeBootstrapHandle(CoreBTypes.scala:407) at scala.tools.nsc.backend.jvm.analysis.BackendUtils.emitLambdaDeserializeIndy$1(BackendUtils.scala:134) at scala.tools.nsc.backend.jvm.analysis.BackendUtils.addLambdaDeserialize(BackendUtils.scala:155) at scala.tools.nsc.backend.jvm.PostProcessor.sendToDisk(PostProcessor.scala:68) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$3(GeneratedClassHandler.scala:131) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$2(GeneratedClassHandler.scala:131) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x00000231828665d8.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.tools.nsc.backend.jvm.PostProcessorFrontendAccess$PostProcessorFrontendAccessImpl.withThreadLocalReporter(PostProcessorFrontendAccess.scala:242) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$1(GeneratedClassHandler.scala:130) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x00000231828643c8.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:687) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x00000231828649a8.apply(Unknown Source) at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467) at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@21.0.2/ThreadPoolExecutor.java:1144) at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@21.0.2/ThreadPoolExecutor.java:642) at java.lang.Thread.runWith(java.base@21.0.2/Thread.java:1596) at java.lang.Thread.run(java.base@21.0.2/Thread.java:1583) "scalac-jvm-non-ast-3": at scala.tools.nsc.backend.jvm.BTypes$LazyVar.get(BTypes.scala:1096) - waiting to lock <0x00000006c94938f8> (a java.lang.Object) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.parseClass(ByteCodeRepository.scala:328) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.$anonfun$parsedClassNode$1(ByteCodeRepository.scala:73) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository$$Lambda/0x00000231827c53a8.apply(Unknown Source) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.$anonfun$getOrElseUpdate$1(JavaCollectionWrappers.scala:369) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike$$Lambda/0x000002318278e2a0.apply(Unknown Source) at java.util.HashMap.computeIfAbsent(java.base@21.0.2/HashMap.java:1228) at java.util.Collections$SynchronizedMap.computeIfAbsent(java.base@21.0.2/Collections.java:2980) - locked <0x00000006c9527430> (a java.util.Collections$SynchronizedMap) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.getOrElseUpdate(JavaCollectionWrappers.scala:369) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.getOrElseUpdate$(JavaCollectionWrappers.scala:368) at scala.collection.convert.JavaCollectionWrappers$AbstractJMapWrapper.getOrElseUpdate(JavaCollectionWrappers.scala:344) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.parsedClassNode(ByteCodeRepository.scala:73) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.classNode(ByteCodeRepository.scala:94) at scala.tools.nsc.backend.jvm.BTypesFromClassfile.$anonfun$classBTypeFromParsedClassfile$1(BTypesFromClassfile.scala:69) at scala.tools.nsc.backend.jvm.BTypesFromClassfile$$Lambda/0x00000231828225e0.apply(Unknown Source) at scala.tools.nsc.backend.jvm.BTypes$ClassBType$.apply(BTypes.scala:828) - locked <0x00000006ebcf5e80> (a scala.tools.nsc.backend.jvm.BTypes$ClassBTypeFromClassfile) at scala.tools.nsc.backend.jvm.BTypesFromClassfile.classBTypeFromParsedClassfile(BTypesFromClassfile.scala:68) at scala.tools.nsc.backend.jvm.BTypesFromClassfile.bTypeForDescriptorFromClassfile(BTypesFromClassfile.scala:59) at scala.tools.nsc.backend.jvm.BTypesFromClassfile.bTypeForDescriptorOrInternalNameFromClassfile(BTypesFromClassfile.scala:44) at scala.tools.nsc.backend.jvm.opt.LocalOpt.isSubType$1(LocalOpt.scala:700) at scala.tools.nsc.backend.jvm.opt.LocalOpt.eliminateRedundantCastsAndRewriteSomeIntrinsics(LocalOpt.scala:749) at scala.tools.nsc.backend.jvm.opt.LocalOpt.removalRound$2(LocalOpt.scala:321) at scala.tools.nsc.backend.jvm.opt.LocalOpt.methodOptimizations(LocalOpt.scala:380) at scala.tools.nsc.backend.jvm.opt.LocalOpt.$anonfun$methodOptimizations$1(LocalOpt.scala:215) at scala.tools.nsc.backend.jvm.opt.LocalOpt.$anonfun$methodOptimizations$1$adapted(LocalOpt.scala:214) at scala.tools.nsc.backend.jvm.opt.LocalOpt$$Lambda/0x0000023182866e38.apply(Unknown Source) at scala.collection.IterableOnceOps.foldLeft(IterableOnce.scala:727) at scala.collection.IterableOnceOps.foldLeft$(IterableOnce.scala:721) at scala.collection.AbstractIterable.foldLeft(Iterable.scala:935) at scala.tools.nsc.backend.jvm.opt.LocalOpt.methodOptimizations(LocalOpt.scala:214) at scala.tools.nsc.backend.jvm.PostProcessor.$anonfun$localOptimizations$1(PostProcessor.scala:131) at scala.tools.nsc.backend.jvm.PostProcessor.localOptimizations(PostProcessor.scala:131) at scala.tools.nsc.backend.jvm.PostProcessor.sendToDisk(PostProcessor.scala:65) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$3(GeneratedClassHandler.scala:131) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$2(GeneratedClassHandler.scala:131) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x00000231828665d8.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.tools.nsc.backend.jvm.PostProcessorFrontendAccess$PostProcessorFrontendAccessImpl.withThreadLocalReporter(PostProcessorFrontendAccess.scala:242) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$1(GeneratedClassHandler.scala:130) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x00000231828643c8.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:687) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x00000231828649a8.apply(Unknown Source) at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467) at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@21.0.2/ThreadPoolExecutor.java:1144) at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@21.0.2/ThreadPoolExecutor.java:642) at java.lang.Thread.runWith(java.base@21.0.2/Thread.java:1596) at java.lang.Thread.run(java.base@21.0.2/Thread.java:1583) Found 1 deadlock. ```
som-snytt commented 8 months ago

Unusual [sic] error on fresh clone.

[info] Resolved  dependencies
[error] java.util.concurrent.ExecutionException: Boxed Error
[error]         at scala.concurrent.impl.Promise$.resolver(Promise.scala:87)
[error]         at scala.concurrent.impl.Promise$.scala$concurrent$impl$Promise$$resolveTry(Promise.scala:79)
[error]         at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:284)
[error]         at scala.concurrent.Promise.complete(Promise.scala:53)
[error]         at scala.concurrent.Promise.complete$(Promise.scala:52)
[error]         at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:187)
[error]         at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
[error]         at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[error]         at java.base/java.lang.Thread.run(Thread.java:1583)
[error] Caused by: java.lang.AssertionError: assertion failed: Attempts to download https://repo1.maven.org/maven2/org/portable-scala/sbt-crossproject_2.12_1.0/1.3.2/sbt-crossproject_2.12_1.0-1.3.2.pom twice in parallel
[error]         at scala.Predef$.assert(Predef.scala:223)
[error]         at lmcoursier.internal.shaded.coursier.cache.loggers.RefreshLogger$UpdateDisplayRunnable.newEntry(RefreshLogger.scala:132)
[error]         at lmcoursier.internal.shaded.coursier.cache.loggers.RefreshLogger.downloadingArtifact(RefreshLogger.scala:306)
[error]         at lmcoursier.internal.shaded.coursier.cache.internal.Downloader$Blocking$.remote(Downloader.scala:402)
[error]         at lmcoursier.internal.shaded.coursier.cache.internal.Downloader.$anonfun$remote$6(Downloader.scala:533
[error]         at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
[error]         at scala.util.Success.$anonfun$map$1(Try.scala:255)
[error]         at scala.util.Success.map(Try.scala:213)
[error]         at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
[error]         at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
[error]         at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
[error]         at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[error]         at java.base/java.lang.Thread.run(Thread.java:1583)
[error] (update) java.util.concurrent.ExecutionException: Boxed Error
[warn] Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? (default: r)
lrytz commented 8 months ago

Thanks for the report, I'll try to find time to investigate.

The non-ast threads are created when using -Ybackend-parallelism, which is disabled by default. I think in your project the setting is enabled through the sbt-typelevel-settings sbt plugin. If you want to work around the issue, setting the parallelism to 1 should help.

lrytz commented 8 months ago

This stack dump with the - locked <0x00000006ebcf5e80> ... "frames" is super useful.

One thread is doing

BTypesFromClassfile.classBTypeFromParsedClassfile
BytecodeRepository.parsedClassNode
parsedClasses.getOrElseUpdate
  - lock `SynchronizedMap`
ByteCodeRepository.parseClass
  - acquire frontendLock

where parsedClasses is backed by a Java SynchronizedMap. getOrElseUpdate locks that SynchronizedMap.

The other thread is doing

CoreBTypesFromSymbols.lambdaDeserializeBootstrapHandle
_lambdaDeserializeBootstrapHandle.get
  - lock frontendLock
CoreBTypesFromSymbols.srLambdaDeserialize
BTypesFromSymbols.computeClassInfo
BTypesFromSymbols.buildInlineInfo
ByteCodeRepository.classNode
ByteCodeRepository.parsedClassNode
parsedClasses.getOrElseUpdate
  - acquire `SynchronizedMap`

Probably we can replace the synchronized map by a concurrent one, worst case two racing threads would run parseClass concurrently on the same class which is fine.

durban commented 8 months ago

Thanks for taking a look! I'll try the workaround you suggested.

durban commented 7 months ago

I see there is a PR now, so I don't know if it matters, but here is another example: https://github.com/durban/choam/actions/runs/8562538419/job/23465965876#step:24:875.

Found one Java-level deadlock:
=============================
"pool-8-thread-1":
  waiting to lock monitor 0x000002b52a3a57f0 (object 0x00000006f0000000, a java.lang.Object),
  which is held by "scalac-jvm-non-ast-1"

"scalac-jvm-non-ast-1":
  waiting to lock monitor 0x000002b529e5ec10 (object 0x00000006cad21458, a java.util.Collections$SynchronizedMap),
  which is held by "scalac-jvm-non-ast-2"

"scalac-jvm-non-ast-2":
  waiting to lock monitor 0x000002b52a3a57f0 (object 0x00000006f0000000, a java.lang.Object),
  which is held by "scalac-jvm-non-ast-1"
Stacktrace for these 3 threads: ``` Java stack information for the threads listed above: =================================================== "pool-8-thread-1": at scala.tools.nsc.backend.jvm.BTypes$LazyVar.get(BTypes.scala:1096) - waiting to lock <0x00000006f0000000> (a java.lang.Object) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols.lambdaDeserializeBootstrapHandle(CoreBTypes.scala:407) at scala.tools.nsc.backend.jvm.analysis.BackendUtils.emitLambdaDeserializeIndy$1(BackendUtils.scala:134) at scala.tools.nsc.backend.jvm.analysis.BackendUtils.addLambdaDeserialize(BackendUtils.scala:155) at scala.tools.nsc.backend.jvm.PostProcessor.sendToDisk(PostProcessor.scala:68) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$3(GeneratedClassHandler.scala:131) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$2(GeneratedClassHandler.scala:131) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x000002b4d98f1148.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.tools.nsc.backend.jvm.PostProcessorFrontendAccess$PostProcessorFrontendAccessImpl.withThreadLocalReporter(PostProcessorFrontendAccess.scala:242) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$1(GeneratedClassHandler.scala:130) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x000002b4d98e70b8.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:687) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x000002b4d98e7668.apply(Unknown Source) at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.stealWhileWaiting$1(GeneratedClassHandler.scala:150) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$complete$2(GeneratedClassHandler.scala:170) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.complete(GeneratedClassHandler.scala:168) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$GlobalOptimisingGeneratedClassHandler.complete(GeneratedClassHandler.scala:100) at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.$anonfun$run$1(GenBCode.scala:81) at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.run(GenBCode.scala:78) at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1549) at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1533) at scala.tools.nsc.Global$Run.compileSources(Global.scala:1525) at scala.tools.nsc.Global$Run.compileFiles(Global.scala:1638) at scala.tools.xsbt.CachedCompiler0.run(CompilerBridge.scala:176) at scala.tools.xsbt.CachedCompiler0.run(CompilerBridge.scala:139) - locked <0x00000006cad4b3a0> (a scala.tools.xsbt.CachedCompiler0) at scala.tools.xsbt.CompilerBridge.run(CompilerBridge.scala:43) at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91) at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:193) at sbt.internal.inc.MixedAnalyzingCompiler$$Lambda/0x000002b4d9011ac8.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:248) at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:183) at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:163) at sbt.internal.inc.MixedAnalyzingCompiler$$Lambda/0x000002b4d900db78.apply(Unknown Source) at sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239) at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:163) at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:211) at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:534) at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:534) at sbt.internal.inc.IncrementalCompilerImpl$$Lambda/0x000002b4d89e0da8.apply(Unknown Source) at sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:180) at sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:178) at sbt.internal.inc.Incremental$$$Lambda/0x000002b4d89e2f88.apply(Unknown Source) at sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:464) at sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:116) at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56) at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52) at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:263) at sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:419) at sbt.internal.inc.Incremental$$$Lambda/0x000002b4d89f6438.apply(Unknown Source) at sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:506) at sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:406) at sbt.internal.inc.Incremental$.apply(Incremental.scala:172) at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:534) at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:488) at sbt.internal.inc.IncrementalCompilerImpl$$Lambda/0x000002b4d89b9638.apply(Unknown Source) at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332) at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:425) at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137) at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2371) at sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2321) at sbt.Defaults$$$Lambda/0x000002b4d89ab3a8.apply(Unknown Source) at sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:31) at sbt.internal.server.BspCompileTask$$$Lambda/0x000002b4d89b8000.apply(Unknown Source) at sbt.internal.io.Retry$.apply(Retry.scala:47) at sbt.internal.io.Retry$.apply(Retry.scala:29) at sbt.internal.io.Retry$.apply(Retry.scala:24) at sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:31) at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2319) at sbt.Defaults$$$Lambda/0x000002b4d84b1380.apply(Unknown Source) at scala.Function1.$anonfun$compose$1(Function1.scala:49) at scala.Function1$$Lambda/0x000002b4d82c30e8.apply(Unknown Source) at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63) at sbt.internal.util.$tilde$greater$$Lambda/0x000002b4d8848b30.apply(Unknown Source) at sbt.std.Transform$$anon$4.work(Transform.scala:69) at sbt.Execute.$anonfun$submit$2(Execute.scala:283) at sbt.Execute$$Lambda/0x000002b4d884f210.apply(Unknown Source) at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24) at sbt.Execute.work(Execute.scala:292) at sbt.Execute.$anonfun$submit$1(Execute.scala:283) at sbt.Execute$$Lambda/0x000002b4d884b478.apply(Unknown Source) at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265) at sbt.ConcurrentRestrictions$$anon$4$$Lambda/0x000002b4d884e330.apply(Unknown Source) at sbt.CompletionService$$anon$2.call(CompletionService.scala:65) at java.util.concurrent.FutureTask.run(java.base@21.0.2/FutureTask.java:317) at java.util.concurrent.Executors$RunnableAdapter.call(java.base@21.0.2/Executors.java:572) at java.util.concurrent.FutureTask.run(java.base@21.0.2/FutureTask.java:317) at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@21.0.2/ThreadPoolExecutor.java:1144) at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@21.0.2/ThreadPoolExecutor.java:642) at java.lang.Thread.runWith(java.base@21.0.2/Thread.java:1596) at java.lang.Thread.run(java.base@21.0.2/Thread.java:1583) "scalac-jvm-non-ast-1": at java.util.Collections$SynchronizedMap.computeIfAbsent(java.base@21.0.2/Collections.java:2980) - waiting to lock <0x00000006cad21458> (a java.util.Collections$SynchronizedMap) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.getOrElseUpdate(JavaCollectionWrappers.scala:369) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.getOrElseUpdate$(JavaCollectionWrappers.scala:368) at scala.collection.convert.JavaCollectionWrappers$AbstractJMapWrapper.getOrElseUpdate(JavaCollectionWrappers.scala:344) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.parsedClassNode(ByteCodeRepository.scala:73) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.classNode(ByteCodeRepository.scala:94) at scala.tools.nsc.backend.jvm.BTypesFromSymbols.buildInlineInfo(BTypesFromSymbols.scala:544) at scala.tools.nsc.backend.jvm.BTypesFromSymbols.computeClassInfo(BTypesFromSymbols.scala:456) at scala.tools.nsc.backend.jvm.BTypesFromSymbols.$anonfun$classBTypeFromSymbolInit$1(BTypesFromSymbols.scala:116) at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$Lambda/0x000002b4d92d8e60.apply(Unknown Source) at scala.tools.nsc.backend.jvm.BTypes$ClassBType$.apply(BTypes.scala:828) - locked <0x00000006f0c3fd60> (a scala.tools.nsc.backend.jvm.BTypes$ClassBTypeFromSymbol) at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:106) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols.$anonfun$_srLambdaDeserialize$1(CoreBTypes.scala:226) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols$$Lambda/0x000002b4da0315c0.apply(Unknown Source) at scala.tools.nsc.backend.jvm.BTypes$LazyVar.$anonfun$get$1(BTypes.scala:1097) at scala.tools.nsc.backend.jvm.BTypes$LazyVar.get(BTypes.scala:1096) - locked <0x00000006f0000000> (a java.lang.Object) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols.srLambdaDeserialize(CoreBTypes.scala:225) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols.$anonfun$_lambdaDeserializeBootstrapHandle$1(CoreBTypes.scala:410) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols$$Lambda/0x000002b4da031308.apply(Unknown Source) at scala.tools.nsc.backend.jvm.BTypes$LazyVar.$anonfun$get$1(BTypes.scala:1097) at scala.tools.nsc.backend.jvm.BTypes$LazyVar.get(BTypes.scala:1096) - locked <0x00000006f0000000> (a java.lang.Object) at scala.tools.nsc.backend.jvm.CoreBTypesFromSymbols.lambdaDeserializeBootstrapHandle(CoreBTypes.scala:407) at scala.tools.nsc.backend.jvm.analysis.BackendUtils.emitLambdaDeserializeIndy$1(BackendUtils.scala:134) at scala.tools.nsc.backend.jvm.analysis.BackendUtils.addLambdaDeserialize(BackendUtils.scala:155) at scala.tools.nsc.backend.jvm.PostProcessor.sendToDisk(PostProcessor.scala:68) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$3(GeneratedClassHandler.scala:131) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$2(GeneratedClassHandler.scala:131) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x000002b4d98f1148.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.tools.nsc.backend.jvm.PostProcessorFrontendAccess$PostProcessorFrontendAccessImpl.withThreadLocalReporter(PostProcessorFrontendAccess.scala:242) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$1(GeneratedClassHandler.scala:130) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x000002b4d98e70b8.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:687) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x000002b4d98e7668.apply(Unknown Source) at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467) at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@21.0.2/ThreadPoolExecutor.java:1144) at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@21.0.2/ThreadPoolExecutor.java:642) at java.lang.Thread.runWith(java.base@21.0.2/Thread.java:1596) at java.lang.Thread.run(java.base@21.0.2/Thread.java:1583) "scalac-jvm-non-ast-2": at scala.tools.nsc.backend.jvm.BTypes$LazyVar.get(BTypes.scala:1096) - waiting to lock <0x00000006f0000000> (a java.lang.Object) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.parseClass(ByteCodeRepository.scala:328) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.$anonfun$parsedClassNode$1(ByteCodeRepository.scala:73) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository$$Lambda/0x000002b4d9863048.apply(Unknown Source) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.$anonfun$getOrElseUpdate$1(JavaCollectionWrappers.scala:369) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike$$Lambda/0x000002b4d9855588.apply(Unknown Source) at java.util.HashMap.computeIfAbsent(java.base@21.0.2/HashMap.java:1228) at java.util.Collections$SynchronizedMap.computeIfAbsent(java.base@21.0.2/Collections.java:2980) - locked <0x00000006cad21458> (a java.util.Collections$SynchronizedMap) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.getOrElseUpdate(JavaCollectionWrappers.scala:369) at scala.collection.convert.JavaCollectionWrappers$JMapWrapperLike.getOrElseUpdate$(JavaCollectionWrappers.scala:368) at scala.collection.convert.JavaCollectionWrappers$AbstractJMapWrapper.getOrElseUpdate(JavaCollectionWrappers.scala:344) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.parsedClassNode(ByteCodeRepository.scala:73) at scala.tools.nsc.backend.jvm.opt.ByteCodeRepository.classNode(ByteCodeRepository.scala:94) at scala.tools.nsc.backend.jvm.BTypesFromClassfile.$anonfun$classBTypeFromParsedClassfile$1(BTypesFromClassfile.scala:69) at scala.tools.nsc.backend.jvm.BTypesFromClassfile$$Lambda/0x000002b4d98a85a8.apply(Unknown Source) at scala.tools.nsc.backend.jvm.BTypes$ClassBType$.apply(BTypes.scala:828) - locked <0x00000006f0f7d7c0> (a scala.tools.nsc.backend.jvm.BTypes$ClassBTypeFromClassfile) at scala.tools.nsc.backend.jvm.BTypesFromClassfile.classBTypeFromParsedClassfile(BTypesFromClassfile.scala:68) at scala.tools.nsc.backend.jvm.BTypesFromClassfile.bTypeForDescriptorFromClassfile(BTypesFromClassfile.scala:59) at scala.tools.nsc.backend.jvm.BTypesFromClassfile.bTypeForDescriptorOrInternalNameFromClassfile(BTypesFromClassfile.scala:44) at scala.tools.nsc.backend.jvm.opt.LocalOpt.isSubType$1(LocalOpt.scala:700) at scala.tools.nsc.backend.jvm.opt.LocalOpt.eliminateRedundantCastsAndRewriteSomeIntrinsics(LocalOpt.scala:749) at scala.tools.nsc.backend.jvm.opt.LocalOpt.removalRound$2(LocalOpt.scala:321) at scala.tools.nsc.backend.jvm.opt.LocalOpt.methodOptimizations(LocalOpt.scala:380) at scala.tools.nsc.backend.jvm.opt.LocalOpt.$anonfun$methodOptimizations$1(LocalOpt.scala:215) at scala.tools.nsc.backend.jvm.opt.LocalOpt.$anonfun$methodOptimizations$1$adapted(LocalOpt.scala:214) at scala.tools.nsc.backend.jvm.opt.LocalOpt$$Lambda/0x000002b4d98f16d0.apply(Unknown Source) at scala.collection.IterableOnceOps.foldLeft(IterableOnce.scala:727) at scala.collection.IterableOnceOps.foldLeft$(IterableOnce.scala:721) at scala.collection.AbstractIterable.foldLeft(Iterable.scala:935) at scala.tools.nsc.backend.jvm.opt.LocalOpt.methodOptimizations(LocalOpt.scala:214) at scala.tools.nsc.backend.jvm.PostProcessor.$anonfun$localOptimizations$1(PostProcessor.scala:131) at scala.tools.nsc.backend.jvm.PostProcessor.localOptimizations(PostProcessor.scala:131) at scala.tools.nsc.backend.jvm.PostProcessor.sendToDisk(PostProcessor.scala:65) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$3(GeneratedClassHandler.scala:131) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$2(GeneratedClassHandler.scala:131) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x000002b4d98f1148.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.tools.nsc.backend.jvm.PostProcessorFrontendAccess$PostProcessorFrontendAccessImpl.withThreadLocalReporter(PostProcessorFrontendAccess.scala:242) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler.$anonfun$postProcessUnit$1(GeneratedClassHandler.scala:130) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x000002b4d98e70b8.apply$mcV$sp(Unknown Source) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:687) at scala.tools.nsc.backend.jvm.GeneratedClassHandler$WritingClassHandler$$Lambda/0x000002b4d98e7668.apply(Unknown Source) at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467) at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@21.0.2/ThreadPoolExecutor.java:1144) at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@21.0.2/ThreadPoolExecutor.java:642) at java.lang.Thread.runWith(java.base@21.0.2/Thread.java:1596) at java.lang.Thread.run(java.base@21.0.2/Thread.java:1583) Found 1 deadlock. ```