Closed deathcap closed 10 years ago
Transitioning through RUNNING first causes an invalid array length error, but allowing the transition directly to ASYNC_WAITING seems to work, although I don't know if there are other unintended consequences of allowing this.
@deathcap: Yeah, only the thread scheduler should ever setState(RUNNING)
, since only one thread should be running at once.
Thanks for catching this.
src/threading.ts can attempt to transition from RUNNABLE to ASYNC_WAITING, in scheduleException():
Reproduction case (unfortunately haven't been able to reduce further — but the problem appears to be triggered by throwing a NoSuchMethodError from another thread(?)):
jar: https://dl.dropboxusercontent.com/u/258156216/java/junket-0.0.1-314-849b703.jar (source: https://github.com/deathcap/Junket/commit/4f3873de1fc0dc39563140aa98c081ba1e72c312)
copy to 'plugins' directory: https://dl.dropboxusercontent.com/u/258156216/java/bukkit-sample-plugin-0.5-05.jar (source: https://github.com/deathcap/SamplePlugin/commit/24580cd03cd76ba818260fb3cd1631dd2d1c76ce)
using doppio natives_refactor as of https://github.com/plasma-umass/doppio/commit/9601860443a48f37db16750bf73983e5bbc39dd6
vs with a native JVM:
According to
validTransitions
, RUNNABLE can currently only transition to RUNNING. Should it transition RUNNABLE => RUNNING => ASYNC_WAITING, or should RUNNABLE => ASYNC_WAITING be added as valid?