Groovy
  1. Groovy
  2. GROOVY-5406

Exception in thread "Thread-2" groovy.lang.GroovyRuntimeException: exception while dumping process stream

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not A Problem
    • Affects Version/s: 1.8.3
    • Fix Version/s: None
    • Component/s: groovy-jdk
    • Labels:
      None
    • Environment:
      JVM 1.6.0_14 on RHEL4u8

      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)
      

        Activity

        Uri Moszkowicz created issue -
        Uri Moszkowicz made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Not A Bug [ 6 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12734329 ] Default workflow, editable Closed status [ 12746107 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12973772 ] Default workflow, editable Closed status [ 12980932 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Uri Moszkowicz
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development