Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-9226

CmdProcess keeps waiting on input pipe if exec was unsuccessful

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Not specified
    • Resolution: Fixed
    • Affects Version/s: 3.10.6
    • Fix Version/s: 3.10.8
    • Component/s: None
    • Labels:
      None

      Description

      callExternalProgram in jutil.cpp does not close the read pipe if the exec fails. This leads to an infinite wait by the parent on the read pipe to close, which will never happen as the forked process is waiting to join with the parent as part of freeing up the resources (calling destructors?) in the exit call. At least that is what the stack trace is making me believe. I won't say I am entirely sure what is going on here.

      In this case, the child process should explicitly close the pipe before calling exit.

      Stack trace for both parent (main thread out of 3 running) and child process attached.

      ECL code to reproduce this scenario:

      IMPORT Std;
      Std.System.Utils.CmdProcess('cat','Hello!');

      Why the exec fails in this simple example is another bug for which I will open another issue now.

        Attachments

          Activity

            People

            • Assignee:
              richardkchapman Richard Chapman
              Reporter:
              starsid Siddhartha Bagaria (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: