Skip to content

airframe-surface: ReflectSurfaceFactory.ofClass(cl) causes illegal multithreaded access to ContextBase error in Scala 3 #1698

@xerial

Description

@xerial

PrimitiveCodecTest shows this error https://github.com/lampepfl/dotty/blob/3.0.0/compiler/src/dotty/tools/dotc/core/Contexts.scala#L967:

 - find the actual codec for Any case objects 3.17ms << error: assertion failed: illegal multithreaded access to ContextBase

java.lang.AssertionError: assertion failed: illegal multithreaded access to ContextBase
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.core.Contexts$ContextState.checkSingleThreaded(Contexts.scala:967)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:182)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:230)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:172)
	at scala.quoted.staging.QuoteCompiler$ExprRun.compileExpr(QuoteCompiler.scala:117)
	at scala.quoted.staging.QuoteDriver.run(QuoteDriver.scala:39)
	at scala.quoted.staging.Compiler$$anon$1.run(Compiler.scala:38)
	at scala.quoted.staging.package$.run(staging.scala:19)
	at wvlet.airframe.surface.reflect.TastySurfaceFactory$.ofClass$$anonfun$1(TastySurfaceFactory.scala:33)
	at scala.collection.concurrent.Map.getOrElseUpdate(Map.scala:99)
	at scala.collection.concurrent.Map.getOrElseUpdate$(Map.scala:96)
	at scala.collection.convert.JavaCollectionWrappers$JConcurrentMapWrapper.getOrElseUpdate(JavaCollectionWrappers.scala:411)
	at wvlet.airframe.surface.reflect.TastySurfaceFactory$.ofClass(TastySurfaceFactory.scala:34)
	at wvlet.airframe.surface.reflect.ReflectSurfaceFactory$.ofClass(ReflectSurfaceFactory.scala:20)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions