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

Presentation compiler crash in pickler #7147

Closed
scabug opened this issue Feb 19, 2013 · 6 comments
Closed

Presentation compiler crash in pickler #7147

scabug opened this issue Feb 19, 2013 · 6 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Feb 19, 2013

2.10.1-RC1 exhibits this weird crash. It seems non-sensical, since the check is if (!clazz.isAnonymousClass), but there it is.. it's anonymous and still crashes. Maybe isAnonymousClass is incorrect.

java.lang.AssertionError: assertion failed: object anon$5
	at scala.tools.nsc.symtab.SymbolLoaders.enterClassAndModule(SymbolLoaders.scala:100)
	at scala.tools.nsc.symtab.SymbolLoaders.initializeFromClassPath(SymbolLoaders.scala:138)
	at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader$$anonfun$doComplete$3.apply(SymbolLoaders.scala:232)
	at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader$$anonfun$doComplete$3.apply(SymbolLoaders.scala:231)
	at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
	at scala.collection.Iterator$class.foreach(Iterator.scala:727)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
	at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
	at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
	at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader.doComplete(SymbolLoaders.scala:231)
	at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:187)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1229)
	at scala.reflect.internal.pickling.UnPickler$Scan.scala$reflect$internal$pickling$UnPickler$Scan$$fromName$1(UnPickler.scala:207)
	at scala.reflect.internal.pickling.UnPickler$Scan.readExtSymbol$1(UnPickler.scala:226)
	at scala.reflect.internal.pickling.UnPickler$Scan.readSymbol(UnPickler.scala:250)
	at scala.reflect.internal.pickling.UnPickler$Scan.readSymbolRef(UnPickler.scala:783)
	at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:346)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:792)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:792)
	at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:171)
	at scala.reflect.internal.pickling.UnPickler$Scan.readTypeRef(UnPickler.scala:792)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$4.apply(UnPickler.scala:347)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$4.apply(UnPickler.scala:347)
	at scala.reflect.internal.pickling.PickleBuffer.until(PickleBuffer.scala:163)
	at scala.reflect.internal.pickling.PickleBuffer.until(PickleBuffer.scala:163)
	at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:347)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:792)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:792)
	at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:171)
	at scala.reflect.internal.pickling.UnPickler$Scan.readTypeRef(UnPickler.scala:792)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readType$2.apply(UnPickler.scala:356)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readType$2.apply(UnPickler.scala:356)
	at scala.reflect.internal.pickling.PickleBuffer.until(PickleBuffer.scala:163)
	at scala.reflect.internal.pickling.PickleBuffer.until(PickleBuffer.scala:163)
	at scala.reflect.internal.pickling.PickleBuffer.until(PickleBuffer.scala:163)
	at scala.reflect.internal.pickling.PickleBuffer.until(PickleBuffer.scala:163)
	at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:356)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:792)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:792)
	at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:171)
	at scala.reflect.internal.pickling.UnPickler$Scan.readTypeRef(UnPickler.scala:792)
	at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:366)
	at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef$$anonfun$34.apply(UnPickler.scala:855)
	at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef$$anonfun$34.apply(UnPickler.scala:855)
	at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:171)
	at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.complete(UnPickler.scala:855)
	at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.load(UnPickler.scala:863)
	at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.initRoot(SymbolLoaders.scala:215)
	at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:199)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1229)
	at scala.reflect.internal.Types$TypeRef.baseTypeSeqImpl(Types.scala:2436)
	at scala.reflect.internal.Types$class.defineBaseTypeSeqOfTypeRef(Types.scala:2562)
	at scala.reflect.internal.SymbolTable.defineBaseTypeSeqOfTypeRef(SymbolTable.scala:13)
	at scala.reflect.internal.Types$TypeRef.baseTypeSeq(Types.scala:2443)
	at scala.reflect.internal.BaseTypeSeqs$class.compoundBaseTypeSeq(BaseTypeSeqs.scala:168)
	at scala.reflect.internal.SymbolTable.compoundBaseTypeSeq(SymbolTable.scala:13)
	at scala.reflect.internal.Types$class.defineBaseTypeSeqOfCompoundType(Types.scala:1706)
	at scala.reflect.internal.SymbolTable.defineBaseTypeSeqOfCompoundType(SymbolTable.scala:13)
	at scala.reflect.internal.Types$CompoundType.baseTypeSeq(Types.scala:1602)
	at scala.reflect.internal.Types$PolyType.baseTypeSeq(Types.scala:2701)
	at scala.reflect.internal.Types$TypeRef.baseTypeSeqImpl(Types.scala:2436)
	at scala.reflect.internal.Types$class.defineBaseTypeSeqOfTypeRef(Types.scala:2562)
	at scala.reflect.internal.SymbolTable.defineBaseTypeSeqOfTypeRef(SymbolTable.scala:13)
	at scala.reflect.internal.Types$TypeRef.baseTypeSeq(Types.scala:2443)
	at scala.reflect.internal.BaseTypeSeqs$class.compoundBaseTypeSeq(BaseTypeSeqs.scala:168)
	at scala.reflect.internal.SymbolTable.compoundBaseTypeSeq(SymbolTable.scala:13)
	at scala.reflect.internal.Types$class.defineBaseTypeSeqOfCompoundType(Types.scala:1706)
	at scala.reflect.internal.SymbolTable.defineBaseTypeSeqOfCompoundType(SymbolTable.scala:13)
	at scala.reflect.internal.Types$CompoundType.baseTypeSeq(Types.scala:1602)
	at scala.reflect.internal.Types$PolyType.baseTypeSeq(Types.scala:2701)
	at scala.reflect.internal.Types$TypeRef.baseTypeSeqImpl(Types.scala:2436)
	at scala.reflect.internal.Types$class.defineBaseTypeSeqOfTypeRef(Types.scala:2562)
	at scala.reflect.internal.SymbolTable.defineBaseTypeSeqOfTypeRef(SymbolTable.scala:13)
	at scala.reflect.internal.Types$TypeRef.baseTypeSeq(Types.scala:2443)
	at scala.reflect.internal.BaseTypeSeqs$class.compoundBaseTypeSeq(BaseTypeSeqs.scala:168)
	at scala.reflect.internal.SymbolTable.compoundBaseTypeSeq(SymbolTable.scala:13)
	at scala.reflect.internal.Types$class.defineBaseTypeSeqOfCompoundType(Types.scala:1706)
	at scala.reflect.internal.SymbolTable.defineBaseTypeSeqOfCompoundType(SymbolTable.scala:13)
	at scala.reflect.internal.Types$CompoundType.baseTypeSeq(Types.scala:1602)
	at scala.reflect.internal.Types$PolyType.baseTypeSeq(Types.scala:2701)
	at scala.reflect.internal.Types$TypeRef.baseTypeSeqImpl(Types.scala:2436)
	at scala.reflect.internal.Types$class.defineBaseTypeSeqOfTypeRef(Types.scala:2562)
	at scala.reflect.internal.SymbolTable.defineBaseTypeSeqOfTypeRef(SymbolTable.scala:13)
	at scala.reflect.internal.Types$TypeRef.baseTypeSeq(Types.scala:2443)
	at scala.reflect.internal.BaseTypeSeqs$class.compoundBaseTypeSeq(BaseTypeSeqs.scala:168)
	at scala.reflect.internal.SymbolTable.compoundBaseTypeSeq(SymbolTable.scala:13)
	at scala.reflect.internal.Types$class.defineBaseTypeSeqOfCompoundType(Types.scala:1706)
	at scala.reflect.internal.SymbolTable.defineBaseTypeSeqOfCompoundType(SymbolTable.scala:13)
	at scala.reflect.internal.Types$CompoundType.baseTypeSeq(Types.scala:1602)
	at scala.reflect.internal.Symbols$Symbol.baseTypeSeqLength$1(Symbols.scala:1619)
	at scala.reflect.internal.Symbols$Symbol.isLess(Symbols.scala:1622)
	at scala.reflect.internal.Types$Type.baseTypeIndex(Types.scala:992)
	at scala.reflect.internal.Symbols$TypeSymbol.isNonBottomSubClass(Symbols.scala:2812)
	at scala.reflect.internal.Symbols$Symbol.isSubClass(Symbols.scala:1641)
	at scala.reflect.internal.Symbols$Symbol.isWeakSubClass(Symbols.scala:1647)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.isImpossibleSubType(Implicits.scala:540)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.isPlausiblySubType(Implicits.scala:534)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.loop$1(Implicits.scala:501)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.checkCompatibility(Implicits.scala:528)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.isPlausiblyCompatible(Implicits.scala:336)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.survives(Implicits.scala:785)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$12$$anonfun$13.apply(Implicits.scala:815)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$12$$anonfun$13.apply(Implicits.scala:815)
	at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at scala.collection.TraversableLike$class.filter(TraversableLike.scala:263)
	at scala.collection.AbstractTraversable.filter(Traversable.scala:105)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$12.apply(Implicits.scala:815)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation$$anonfun$12.apply(Implicits.scala:814)
	at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
	at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
	at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.<init>(Implicits.scala:814)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:935)
	at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1304)
	at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:82)
	at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:492)
	at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:40)
	at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:492)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$wrapImplicit$1(Typers.scala:197)
	at scala.tools.nsc.typechecker.Typers$Typer.inferView(Typers.scala:204)
	at scala.tools.nsc.typechecker.Typers$Typer.adaptToMember(Typers.scala:1322)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$17.apply(Typers.scala:1387)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$17.apply(Typers.scala:1387)
	at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:739)
	at scala.tools.nsc.typechecker.Typers$Typer.adaptToMemberWithArgs(Typers.scala:1387)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedSelect$1(Typers.scala:4797)
	at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:4935)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5548)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5627)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$95.apply(Typers.scala:4612)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$95.apply(Typers.scala:4612)
	at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:721)
	at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4612)
	at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4663)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5549)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5627)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5701)
	at scala.tools.nsc.typechecker.Typers$Typer.computeType(Typers.scala:5785)
	at scala.tools.nsc.typechecker.Namers$Namer.assignTypeToTree(Namers.scala:828)
	at scala.tools.nsc.typechecker.Namers$Namer.methodSig(Namers.scala:1156)
	at scala.tools.nsc.typechecker.Namers$Namer.getSig$1(Namers.scala:1443)
	at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1455)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply$mcV$sp(Namers.scala:725)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:724)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:724)
	at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$logAndValidate(Namers.scala:1488)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:724)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:723)
	at scala.tools.nsc.typechecker.Namers$$anon$1.completeImpl(Namers.scala:1603)
	at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1611)
	at scala.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1601)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1229)
	at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1365)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5279)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5627)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2914)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3018)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3018)
	at scala.collection.immutable.List.loop$1(List.scala:170)
	at scala.collection.immutable.List.mapConserve(List.scala:186)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3018)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1907)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1789)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5569)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5627)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2914)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3018)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3018)
	at scala.collection.immutable.List.loop$1(List.scala:170)
	at scala.collection.immutable.List.mapConserve(List.scala:186)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3018)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5285)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5572)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5627)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5684)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:99)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:463)
	at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1157)
	at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1157)
	at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:208)
	at scala.tools.nsc.interactive.Global$TyperRun.applyPhase(Global.scala:1157)
	at scala.tools.nsc.interactive.Global$TyperRun.typeCheck(Global.scala:1150)
	at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$typeCheck(Global.scala:586)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5$$anonfun$apply$7.apply(Global.scala:502)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5.apply(Global.scala:498)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5.apply(Global.scala:498)
	at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
	at scala.collection.immutable.List.foreach(List.scala:318)
	at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
	at scala.tools.nsc.interactive.Global.backgroundCompile(Global.scala:498)
	at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:25)
@scabug
Copy link
Author

@scabug scabug commented Feb 19, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7147?orig=1
Reporter: @dragos
Affected Versions: 2.10.1-RC2, 2.10.1-RC3, 2.10.1

@scabug
Copy link
Author

@scabug scabug commented Feb 19, 2013

@dragos said:
Actually it makes sense, the if looks for an anonymous class, and the assertion prints the object. This might be related to #SI-6576, both rely on connecting a class to its companion object.

@scabug
Copy link
Author

@scabug scabug commented Feb 20, 2013

@dragos said:
I actually noticed it using 2.10.1-SNAPSHOT, so I updated the affected version to be 2.10.1-RC2.

@scabug
Copy link
Author

@scabug scabug commented Apr 2, 2013

@retronym said:
Adding a diagnostic error: scala/scala#2344

@scabug
Copy link
Author

@scabug scabug commented May 20, 2013

@JamesIry said:
2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.

@scabug
Copy link
Author

@scabug scabug commented Jun 3, 2013

@retronym said:
This turned out to be due to concurrent access to the name table by the presentation compiler.

Iulian's mail:

As a temporary solution we will synchronize `newTerm/TypeName` in the IDE. This should provide enough protection for names, and I think that's the root cause here.

I'll also prepare a PR for 2.11 to move this in the presentation compiler (interactive.Global). At least the parser (that is meant to be thread-safe) is creating names, so the presentation compiler should account for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants