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

GlobalSymbolLoaders#lookupMemberAtTyperPhaseIfPossible throw NullPointerException with JDK12 #11381

Open
xuwei-k opened this Issue Jan 23, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@xuwei-k
Copy link

xuwei-k commented Jan 23, 2019

build.sbt

scalaVersion := "2.12.8"

project/plugins.sbt

( add -Ydebug for printStackTrace https://github.com/scala/scala/blob/v2.12.8/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala#L115 )

scalacOptions += "-Ydebug"

scalaVersion := "2.12.8"

project/build.properties

sbt.version=1.2.8
$ java --version
openjdk 12-ea 2019-03-19
OpenJDK Runtime Environment (build 12-ea+28)
OpenJDK 64-Bit Server VM (build 12-ea+28, mixed mode, sharing)
$ sbt
[info] Loading settings for project global-plugins from idea.sbt ...
[info] Loading global plugins from /Users/kenji/.sbt/1.0/plugins
error: error while loading String, class file '/modules/java.base/java/lang/String.class' is broken
(class java.lang.NullPointerException/null)
[info] Loading settings for project jdk12-sbt-build from plugins.sbt ...
[info] Loading project definition from /Users/kenji/jdk12-sbt/project
[info] Updating ProjectRef(uri("file:/Users/kenji/jdk12-sbt/project/"), "jdk12-sbt-build")...
[info] Done updating.
java.lang.NullPointerException
	at scala.tools.nsc.GlobalSymbolLoaders.lookupMemberAtTyperPhaseIfPossible(GlobalSymbolLoaders.scala:22)
	at scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader$classfileParser$.lookupMemberAtTyperPhaseIfPossible(SymbolLoaders.scala:298)
	at scala.tools.nsc.symtab.classfile.ClassfileParser$innerClasses$.innerSymbol(ClassfileParser.scala:1261)
	at scala.tools.nsc.symtab.classfile.ClassfileParser$innerClasses$.innerSymbol(ClassfileParser.scala:1252)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.classNameToSymbol(ClassfileParser.scala:432)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.sig2type$1(ClassfileParser.scala:708)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.sig2type$1(ClassfileParser.scala:740)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.scala$tools$nsc$symtab$classfile$ClassfileParser$$sigToType(ClassfileParser.scala:793)
	at scala.tools.nsc.symtab.classfile.ClassfileParser$ConstantPool.getType(ClassfileParser.scala:298)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parseMethod(ClassfileParser.scala:585)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parseClass$4(ClassfileParser.scala:499)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.queueLoad$1(ClassfileParser.scala:499)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parseClass$5(ClassfileParser.scala:509)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parseClass(ClassfileParser.scala:514)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parse$1(ClassfileParser.scala:155)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:126)
	at scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader.doComplete(SymbolLoaders.scala:318)
	at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:220)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1530)
	at scala.reflect.internal.Definitions.scala$reflect$internal$Definitions$$enterNewMethod(Definitions.scala:43)
	at scala.reflect.internal.Definitions$DefinitionsClass.String_$plus$lzycompute(Definitions.scala:1114)
	at scala.reflect.internal.Definitions$DefinitionsClass.String_$plus(Definitions.scala:1114)
	at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreMethods$lzycompute(Definitions.scala:1388)
	at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreMethods(Definitions.scala:1370)
	at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode$lzycompute(Definitions.scala:1400)
	at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode(Definitions.scala:1400)
	at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1456)
	at scala.tools.nsc.Global$Run.<init>(Global.scala:1179)
	at sbt.compiler.Eval$$anon$1.<init>(Eval.scala:206)
	at sbt.compiler.Eval.run$lzycompute$1(Eval.scala:206)
	at sbt.compiler.Eval.run$1(Eval.scala:206)
	at sbt.compiler.Eval.evalCommon(Eval.scala:218)
	at sbt.compiler.Eval.eval(Eval.scala:128)
	at sbt.internal.EvaluateConfigurations$.evaluateDslEntry(EvaluateConfigurations.scala:239)
	at sbt.internal.EvaluateConfigurations$.$anonfun$evaluateSbtFile$2(EvaluateConfigurations.scala:158)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233)
	at scala.collection.immutable.List.foreach(List.scala:388)
	at scala.collection.TraversableLike.map(TraversableLike.scala:233)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:226)
	at scala.collection.immutable.List.map(List.scala:294)
	at sbt.internal.EvaluateConfigurations$.evaluateSbtFile(EvaluateConfigurations.scala:156)
	at sbt.internal.Load$.loadSettingsFile$1(Load.scala:1136)
	at sbt.internal.Load$.$anonfun$discoverProjects$2(Load.scala:1144)
	at scala.collection.MapLike.getOrElse(MapLike.scala:127)
	at scala.collection.MapLike.getOrElse$(MapLike.scala:125)
	at scala.collection.AbstractMap.getOrElse(Map.scala:59)
	at sbt.internal.Load$.memoLoadSettingsFile$1(Load.scala:1143)
	at sbt.internal.Load$.$anonfun$discoverProjects$4(Load.scala:1151)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233)
	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:58)
	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:51)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
	at scala.collection.TraversableLike.map(TraversableLike.scala:233)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:226)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at sbt.internal.Load$.loadFiles$1(Load.scala:1151)
	at sbt.internal.Load$.discoverProjects(Load.scala:1165)
	at sbt.internal.Load$.discover$1(Load.scala:862)
	at sbt.internal.Load$.loadTransitive(Load.scala:937)
	at sbt.internal.Load$.loadProjects$1(Load.scala:726)
	at sbt.internal.Load$.$anonfun$loadUnit$11(Load.scala:729)
	at sbt.internal.Load$.timed(Load.scala:1395)
	at sbt.internal.Load$.$anonfun$loadUnit$1(Load.scala:729)
	at sbt.internal.Load$.timed(Load.scala:1395)
	at sbt.internal.Load$.loadUnit(Load.scala:688)
	at sbt.internal.Load$.$anonfun$builtinLoader$4(Load.scala:484)
	at sbt.internal.BuildLoader$.$anonfun$componentLoader$5(BuildLoader.scala:176)
	at sbt.internal.BuildLoader.apply(BuildLoader.scala:241)
	at sbt.internal.Load$.loadURI$1(Load.scala:546)
	at sbt.internal.Load$.loadAll(Load.scala:562)
	at sbt.internal.Load$.loadURI(Load.scala:492)
	at sbt.internal.Load$.load(Load.scala:471)
	at sbt.internal.Load$.$anonfun$apply$1(Load.scala:251)
	at sbt.internal.Load$.timed(Load.scala:1395)
	at sbt.internal.Load$.apply(Load.scala:251)
	at sbt.internal.Load$.defaultLoad(Load.scala:69)
	at sbt.BuiltinCommands$.liftedTree1$1(Main.scala:829)
	at sbt.BuiltinCommands$.doLoadProject(Main.scala:829)
	at sbt.BuiltinCommands$.$anonfun$loadProjectImpl$2(Main.scala:800)
	at sbt.Command$.$anonfun$applyEffect$4(Command.scala:142)
	at sbt.Command$.$anonfun$applyEffect$2(Command.scala:137)
	at sbt.Command$.process(Command.scala:181)
	at sbt.MainLoop$.processCommand(MainLoop.scala:151)
	at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:139)
	at sbt.State$$anon$1.runCmd$1(State.scala:246)
	at sbt.State$$anon$1.process(State.scala:250)
	at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:139)
	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
	at sbt.MainLoop$.next(MainLoop.scala:139)
	at sbt.MainLoop$.run(MainLoop.scala:132)
	at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:110)
	at sbt.io.Using.apply(Using.scala:22)
	at sbt.MainLoop$.runWithNewLog(MainLoop.scala:104)
	at sbt.MainLoop$.runAndClearLast(MainLoop.scala:59)
	at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:44)
	at sbt.MainLoop$.runLogged(MainLoop.scala:35)
	at sbt.StandardMain$.runManaged(Main.scala:138)
	at sbt.xMain.run(Main.scala:89)
	at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
	at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
	at xsbt.boot.Launch$.run(Launch.scala:109)
	at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
	at xsbt.boot.Launch$.launch(Launch.scala:117)
	at xsbt.boot.Launch$.apply(Launch.scala:18)
	at xsbt.boot.Boot$.runImpl(Boot.scala:56)
	at xsbt.boot.Boot$.main(Boot.scala:18)
	at xsbt.boot.Boot.main(Boot.scala)
java.io.IOException: class file '/modules/java.base/java/lang/String.class' is broken
(class java.lang.NullPointerException/null)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.scala$tools$nsc$symtab$classfile$ClassfileParser$$handleError(ClassfileParser.scala:109)
	at scala.tools.nsc.symtab.classfile.ClassfileParser$$anonfun$scala$tools$nsc$symtab$classfile$ClassfileParser$$parseErrorHandler$1.applyOrElse(ClassfileParser.scala:117)
	at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:34)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:127)
	at scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader.doComplete(SymbolLoaders.scala:318)
	at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:220)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1530)
	at scala.reflect.internal.Definitions.scala$reflect$internal$Definitions$$enterNewMethod(Definitions.scala:43)
	at scala.reflect.internal.Definitions$DefinitionsClass.String_$plus$lzycompute(Definitions.scala:1114)
	at scala.reflect.internal.Definitions$DefinitionsClass.String_$plus(Definitions.scala:1114)
	at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreMethods$lzycompute(Definitions.scala:1388)
	at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreMethods(Definitions.scala:1370)
	at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode$lzycompute(Definitions.scala:1400)
	at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode(Definitions.scala:1400)
	at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1456)
	at scala.tools.nsc.Global$Run.<init>(Global.scala:1179)
	at sbt.compiler.Eval$$anon$1.<init>(Eval.scala:206)
	at sbt.compiler.Eval.run$lzycompute$1(Eval.scala:206)
	at sbt.compiler.Eval.run$1(Eval.scala:206)
	at sbt.compiler.Eval.evalCommon(Eval.scala:218)
	at sbt.compiler.Eval.eval(Eval.scala:128)
	at sbt.internal.EvaluateConfigurations$.evaluateDslEntry(EvaluateConfigurations.scala:239)
	at sbt.internal.EvaluateConfigurations$.$anonfun$evaluateSbtFile$2(EvaluateConfigurations.scala:158)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233)
	at scala.collection.immutable.List.foreach(List.scala:388)
	at scala.collection.TraversableLike.map(TraversableLike.scala:233)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:226)
	at scala.collection.immutable.List.map(List.scala:294)
	at sbt.internal.EvaluateConfigurations$.evaluateSbtFile(EvaluateConfigurations.scala:156)
	at sbt.internal.Load$.loadSettingsFile$1(Load.scala:1136)
	at sbt.internal.Load$.$anonfun$discoverProjects$2(Load.scala:1144)
	at scala.collection.MapLike.getOrElse(MapLike.scala:127)
	at scala.collection.MapLike.getOrElse$(MapLike.scala:125)
	at scala.collection.AbstractMap.getOrElse(Map.scala:59)
	at sbt.internal.Load$.memoLoadSettingsFile$1(Load.scala:1143)
	at sbt.internal.Load$.$anonfun$discoverProjects$4(Load.scala:1151)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233)
	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:58)
	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:51)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
	at scala.collection.TraversableLike.map(TraversableLike.scala:233)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:226)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at sbt.internal.Load$.loadFiles$1(Load.scala:1151)
	at sbt.internal.Load$.discoverProjects(Load.scala:1165)
	at sbt.internal.Load$.discover$1(Load.scala:862)
	at sbt.internal.Load$.loadTransitive(Load.scala:937)
	at sbt.internal.Load$.loadProjects$1(Load.scala:726)
	at sbt.internal.Load$.$anonfun$loadUnit$11(Load.scala:729)
	at sbt.internal.Load$.timed(Load.scala:1395)
	at sbt.internal.Load$.$anonfun$loadUnit$1(Load.scala:729)
	at sbt.internal.Load$.timed(Load.scala:1395)
	at sbt.internal.Load$.loadUnit(Load.scala:688)
	at sbt.internal.Load$.$anonfun$builtinLoader$4(Load.scala:484)
	at sbt.internal.BuildLoader$.$anonfun$componentLoader$5(BuildLoader.scala:176)
	at sbt.internal.BuildLoader.apply(BuildLoader.scala:241)
	at sbt.internal.Load$.loadURI$1(Load.scala:546)
	at sbt.internal.Load$.loadAll(Load.scala:562)
	at sbt.internal.Load$.loadURI(Load.scala:492)
	at sbt.internal.Load$.load(Load.scala:471)
	at sbt.internal.Load$.$anonfun$apply$1(Load.scala:251)
	at sbt.internal.Load$.timed(Load.scala:1395)
	at sbt.internal.Load$.apply(Load.scala:251)
	at sbt.internal.Load$.defaultLoad(Load.scala:69)
	at sbt.BuiltinCommands$.liftedTree1$1(Main.scala:829)
	at sbt.BuiltinCommands$.doLoadProject(Main.scala:829)
	at sbt.BuiltinCommands$.$anonfun$loadProjectImpl$2(Main.scala:800)
	at sbt.Command$.$anonfun$applyEffect$4(Command.scala:142)
	at sbt.Command$.$anonfun$applyEffect$2(Command.scala:137)
	at sbt.Command$.process(Command.scala:181)
	at sbt.MainLoop$.processCommand(MainLoop.scala:151)
	at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:139)
	at sbt.State$$anon$1.runCmd$1(State.scala:246)
	at sbt.State$$anon$1.process(State.scala:250)
	at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:139)
	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
	at sbt.MainLoop$.next(MainLoop.scala:139)
	at sbt.MainLoop$.run(MainLoop.scala:132)
	at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:110)
	at sbt.io.Using.apply(Using.scala:22)
	at sbt.MainLoop$.runWithNewLog(MainLoop.scala:104)
	at sbt.MainLoop$.runAndClearLast(MainLoop.scala:59)
	at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:44)
	at sbt.MainLoop$.runLogged(MainLoop.scala:35)
	at sbt.StandardMain$.runManaged(Main.scala:138)
	at sbt.xMain.run(Main.scala:89)
	at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
	at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
	at xsbt.boot.Launch$.run(Launch.scala:109)
	at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
	at xsbt.boot.Launch$.launch(Launch.scala:117)
	at xsbt.boot.Launch$.apply(Launch.scala:18)
	at xsbt.boot.Boot$.runImpl(Boot.scala:56)
	at xsbt.boot.Boot$.main(Boot.scala:18)
	at xsbt.boot.Boot.main(Boot.scala)
error: error while loading String, class file '/modules/java.base/java/lang/String.class' is broken
(class java.lang.NullPointerException/null)
[running phase namer on /Users/kenji/jdk12-sbt/build.sbt]
[running phase packageobjects on /Users/kenji/jdk12-sbt/build.sbt]
[running phase typer on /Users/kenji/jdk12-sbt/build.sbt]
[running phase patmat on /Users/kenji/jdk12-sbt/build.sbt]
[running phase superaccessors on /Users/kenji/jdk12-sbt/build.sbt]
[running phase extmethods on /Users/kenji/jdk12-sbt/build.sbt]
[running phase pickler on /Users/kenji/jdk12-sbt/build.sbt]
[running phase refchecks on /Users/kenji/jdk12-sbt/build.sbt]
[running phase uncurry on /Users/kenji/jdk12-sbt/build.sbt]
[running phase fields on /Users/kenji/jdk12-sbt/build.sbt]
[running phase tailcalls on /Users/kenji/jdk12-sbt/build.sbt]
[running phase specialize on /Users/kenji/jdk12-sbt/build.sbt]
[running phase explicitouter on /Users/kenji/jdk12-sbt/build.sbt]
[running phase erasure on /Users/kenji/jdk12-sbt/build.sbt]
[running phase posterasure on /Users/kenji/jdk12-sbt/build.sbt]
[running phase lambdalift on /Users/kenji/jdk12-sbt/build.sbt]
[running phase constructors on /Users/kenji/jdk12-sbt/build.sbt]
[running phase flatten on /Users/kenji/jdk12-sbt/build.sbt]
[running phase mixin on /Users/kenji/jdk12-sbt/build.sbt]
[running phase cleanup on /Users/kenji/jdk12-sbt/build.sbt]
[running phase delambdafy on /Users/kenji/jdk12-sbt/build.sbt]
[running phase jvm on /Users/kenji/jdk12-sbt/build.sbt]
[info] Loading settings for project jdk12-sbt from build.sbt ...
[info] Set current project to jdk12-sbt (in build file:/Users/kenji/jdk12-sbt/)
[info] sbt server started at local:///Users/kenji/.sbt/1.0/server/dc729e77166a72f0c878/sock
jdk12-sbt master > 

I'm not sure this is a scalac issue or sbt issue /cc @eed3si9n

@xuwei-k xuwei-k added the jdk12 label Jan 23, 2019

@xuwei-k xuwei-k added this to the 2.12.9 milestone Jan 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment