NPE on Windows during incremental recompilation if exportJars := true

11 views
Skip to first unread message

Alexey Vakhrenev

unread,
Apr 7, 2017, 2:34:48 PM4/7/17
to sbt-dev
Hello!

After upgrading scala from 2.11.8 to 2.12.1, I've started to periodically get  this:

> test
[info] Compiling 1 Scala source to C:\Users\alexey.vakhrenev\dash\api\jvm\target\scala-2.12\classes...
[info] Packaging C:\Users\alexey.vakhrenev\dash\api\jvm\target\scala-2.12\dash-api-internal_2.12-3.9-24-gcc9eb1e2-SNAPSHOT.jar ...
[info] Done packaging.
[info] Compiling 1 Scala source to C:\Users\alexey.vakhrenev\dash\api\jvm\target\scala-2.12\test-classes...
[error] error while loading InternalServices, class file 'C:\Users\alexey.vakhrenev\dash\api\jvm\target\scala-2.12\dash-api-internal_2.12-3.9-24-gcc9eb1e2-SNAPSHOT.jar(dash/internal/api/InternalServices.class)' is broken
[error] (class java.lang.NullPointerException/null)


This doesn't happen after clean rebuild, and also I didn't see it on linux machine.

The sbt version is 0.13.13, jdk 1.8-121, windows 7 64bit.

The stacktrace is:

java.lang.NullPointerException
        at scala
.reflect.io.AbstractFile.toByteArray(AbstractFile.scala:172)
        at scala
.tools.nsc.symtab.classfile.AbstractFileReader.<init>(AbstractFileReader.scala:26)
        at scala
.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parse$1(ClassfileParser.scala:149)
        at scala
.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:127)
        at scala
.tools.nsc.symtab.SymbolLoaders$ClassfileLoader.doComplete(SymbolLoaders.scala:311)
        at scala
.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:213)
        at scala
.tools.nsc.symtab.SymbolLoaders$SymbolLoader.load(SymbolLoaders.scala:229)
        at scala
.tools.nsc.typechecker.Typers$Typer.isStale(Typers.scala:515)
        at scala
.tools.nsc.typechecker.Typers$Typer.reallyExists(Typers.scala:506)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedSelectInternal$1(Typers.scala:4848)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedSelect$1(Typers.scala:4812)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:4939)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5467)
        at scala
.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5483)
        at scala
.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5519)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5549)
        at scala
.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5493)
        at scala
.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5497)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5600)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5608)
        at scala
.tools.nsc.typechecker.Namers$Namer.importSig(Namers.scala:1617)
        at scala
.tools.nsc.typechecker.Namers$Namer.$anonfun$importTypeCompleter$1(Namers.scala:804)
        at scala
.tools.nsc.typechecker.Namers$Namer.$anonfun$importTypeCompleter$1$adapted(Namers.scala:803)
        at scala
.tools.nsc.typechecker.Namers$$anon$1.completeImpl(Namers.scala:1864)
        at scala
.tools.nsc.typechecker.Namers$LockingTypeCompleter.complete(Namers.scala:1872)
        at scala
.tools.nsc.typechecker.Namers$LockingTypeCompleter.complete$(Namers.scala:1870)
        at scala
.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1862)
        at scala
.reflect.internal.Symbols$Symbol.info(Symbols.scala:1512)
        at scala
.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1660)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3050)
        at scala
.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$9(Typers.scala:3206)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3206)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1974)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1845)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5433)
        at scala
.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5482)
        at scala
.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5519)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5549)
        at scala
.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5493)
        at scala
.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5497)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5580)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3062)
        at scala
.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$9(Typers.scala:3206)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3206)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5132)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5435)
        at scala
.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5482)
        at scala
.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5519)
        at scala
.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5549)
        at scala
.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5493)
        at scala
.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5497)
        at scala
.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5576)
        at scala
.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:102)
        at scala
.tools.nsc.Global$GlobalPhase.$anonfun$applyPhase$1(Global.scala:416)
        at scala
.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:409)
        at scala
.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1(Analyzer.scala:94)
        at scala
.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1$adapted(Analyzer.scala:93)
        at scala
.collection.Iterator.foreach(Iterator.scala:929)
        at scala
.collection.Iterator.foreach$(Iterator.scala:929)
        at scala
.collection.AbstractIterator.foreach(Iterator.scala:1406)
        at scala
.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
        at scala
.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1418)
        at scala
.tools.nsc.Global$Run.compileUnits(Global.scala:1403)
        at scala
.tools.nsc.Global$Run.compileSources(Global.scala:1398)
        at scala
.tools.nsc.Global$Run.compile(Global.scala:1492)
        at xsbt
.CachedCompiler0.run(CompilerInterface.scala:116)
        at xsbt
.CachedCompiler0.run(CompilerInterface.scala:95)
        at xsbt
.CompilerInterface.run(CompilerInterface.scala:26)
        at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java
.lang.reflect.Method.invoke(Method.java:498)
        at sbt
.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:107)
        at sbt
.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:53)
        at sbt
.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
        at sbt
.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply$mcV$sp(MixedAnalyzingCompiler.scala:50)
        at sbt
.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
        at sbt
.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
        at sbt
.compiler.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:74)
        at sbt
.compiler.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:49)
        at sbt
.compiler.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:64)
        at sbt
.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
        at sbt
.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
        at sbt
.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
        at sbt
.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
        at sbt
.inc.IncrementalCommon.cycle(IncrementalCommon.scala:32)
        at sbt
.inc.Incremental$$anonfun$1.apply(Incremental.scala:72)
        at sbt
.inc.Incremental$$anonfun$1.apply(Incremental.scala:71)
        at sbt
.inc.Incremental$.manageClassfiles(Incremental.scala:99)
        at sbt
.inc.Incremental$.compile(Incremental.scala:71)
        at sbt
.inc.IncrementalCompile$.apply(Compile.scala:54)
        at sbt
.compiler.IC$.compileInternal(IncrementalCompiler.scala:160)
        at sbt
.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
        at sbt
.Compiler$.compile(Compiler.scala:155)
        at sbt
.Compiler$.compile(Compiler.scala:141)
        at sbt
.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:879)
        at sbt
.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:870)
        at sbt
.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:868)
        at scala
.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt
.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt
.std.Transform$$anon$4.work(System.scala:63)
        at sbt
.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
        at sbt
.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
        at sbt
.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt
.Execute.work(Execute.scala:237)
        at sbt
.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt
.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt
.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
        at sbt
.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java
.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java
.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java
.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java
.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java
.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java
.lang.Thread.run(Thread.java:745)


What should I do about it?

Alexey.


eugene yokota

unread,
Apr 7, 2017, 2:37:00 PM4/7/17
to sbt...@googlegroups.com
Hi Alexey,

That sounds like a bug.
Please report it on GitHub issues following this guide: https://github.com/sbt/sbt/blob/1.0.x/CONTRIBUTING.md

-eugene


--
You received this message because you are subscribed to the Google Groups "sbt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sbt-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbt-dev/4cbd9709-f051-4ce9-9739-ecda442de9aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexey Vakhrenev

unread,
Apr 10, 2017, 6:18:54 AM4/10/17
to sbt-dev
https://github.com/sbt/sbt/issues/3090

Thank you!

пятница, 7 апреля 2017 г., 21:37:00 UTC+3 пользователь eugene yokota написал:
To unsubscribe from this group and stop receiving emails from it, send an email to sbt-dev+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages