You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
If a ProcessBuilder process is internally executed on a background thread (the choice of which depends on how the process is built), exceptions thrown by a call to the underlying java.lang.ProcessBuilder.start() method are uncaught, leading to:
The exception hitting the thread's uncaught exception handler, and
The above reproduction case will deadlock waiting for initial execution of the process:
scala> Try(("does-not-exist" #< new ByteArrayInputStream("foo".getBytes("utf-8"))).lines)
Exception in thread "Thread-3" java.io.IOException: Cannot run program "does-not-exist": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:68)
at scala.sys.process.ProcessImpl$PipedProcesses.runAndExitValue(ProcessImpl.scala:131)
at scala.sys.process.ProcessImpl$CompoundProcess$$anonfun$1.apply$mcV$sp(ProcessImpl.scala:93)
at scala.sys.process.ProcessImpl$Spawn$$anon$1.run(ProcessImpl.scala:22)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
... 4 more
Exception in thread "Thread-6" java.lang.RuntimeException: No exit code: process destroyed.
at scala.sys.process.ProcessImpl$CompoundProcess.exitValue(ProcessImpl.scala:87)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder$$anonfun$lines$1.apply$mcV$sp(ProcessBuilderImpl.scala:142)
at scala.sys.process.ProcessImpl$Spawn$$anon$1.run(ProcessImpl.scala:22)
// deadlocked here
If a ProcessBuilder process is internally executed on a background thread (the choice of which depends on how the process is built), exceptions thrown by a call to the underlying java.lang.ProcessBuilder.start() method are uncaught, leading to:
A reproduction case for 2.10.3:
The above reproduction case will deadlock waiting for initial execution of the process:
The bug appears to be due to
IOException
being thrown byjava.lang.ProcessBuilder
, but not being caught by its caller inscala.sys.process.ProcessBuilderImpl.Simple.run()
.The text was updated successfully, but these errors were encountered: