Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Not A Bug
-
Affects Version/s: 1.8.3
-
Fix Version/s: None
-
Component/s: groovy-jdk
-
Labels:None
-
Environment:JVM 1.6.0_14 on RHEL4u8
-
Number of attachments :
Description
I received the following crash from a Groovy script sometimes:
Exception in thread "Thread-2" groovy.lang.GroovyRuntimeException: exception while dumping process stream
at org.codehaus.groovy.runtime.ProcessGroovyMethods$ByteDumper.run(ProcessGroovyMethods.java:488)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: Bad file descriptor
at java.io.FileInputStream.available(Native Method)
at java.io.BufferedInputStream.read(BufferedInputStream.java:325)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
at org.codehaus.groovy.runtime.ProcessGroovyMethods$ByteDumper.run(ProcessGroovyMethods.java:484)
... 1 more
I can't trap the exception from within the script and there's a few nested Groovy scripts but my guess is that it's from the call to Process.destroy(). Below is a snippet from my script which performs that call:
def process =
["/tools/bin/reQrsh", "-q", "batch.q,compile.q", "-verbose", "-now", "n",
"-cwd", "-V", "-l", "os=redhat4$cbOpt,h_rt=28800",
"./$bobExe $bobArgs"].execute()
def pipedOutputStream = new PipedOutputStream()
process.consumeProcessOutput(
new TeeOutputStream(System.out, pipedOutputStream),
new TeeOutputStream(System.err, pipedOutputStream))
new PipedInputStream(pipedOutputStream).eachLine \{
(it =~ /<stripped>/).find \{ process.destroy() \}
\}
System.exit(0)