Duhemm / sbt-errors-summary

sbt plugin to show a summary of compilation messages.
MIT License
201 stars 11 forks source link

Reporter is not thread safe #46

Open dragos opened 4 years ago

dragos commented 4 years ago

The reporter fails on reset if errors are reported from multiple threads.

java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 16
    at scala.collection.mutable.ResizableArray.reduceToSize(ResizableArray.scala:91)
    at scala.collection.mutable.ResizableArray.reduceToSize$(ResizableArray.scala:87)
    at scala.collection.mutable.ArrayBuffer.reduceToSize(ArrayBuffer.scala:49)
    at scala.collection.mutable.ArrayBuffer.clear(ArrayBuffer.scala:66)
    at sbt.errorssummary.Reporter.reset(Reporter.scala:28)
    at xsbt.DelegatingReporter.reset(DelegatingReporter.scala:155)
    at com.github.ghik.silencer.SuppressingReporter.reset(SuppressingReporter.scala:35)
    at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1654)
    at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1651)
    at scala.tools.nsc.Global$Run.compileSources(Global.scala:1644)
    at scala.tools.nsc.Global$Run.compile(Global.scala:1883)
    at com.triplequote.hydra.compiler.ScalaWorker$ScalaCompilationRound.compile(ScalaWorker.scala:124)
    at com.triplequote.hydra.compiler.ScalaWorker.compile(ScalaWorker.scala:72)
    at com.triplequote.hydra.WorkerThread.$anonfun$run$1(WorkerThread.scala:43)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
    at com.triplequote.hydra.compiler.utils.Utils$.timed(Utils.scala:34)
    at com.triplequote.hydra.WorkerThread.run(WorkerThread.scala:43)