Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8362267

(process) Failure to communicate with child process via fail pipe can lead to zombie processes

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 26
    • core-libs
    • None

      There is a subtle bug in the UNIX implementation for j.l.ProcessBuilder that could lead to zombies being accrued.

      The underlying problem is that we fork, then exec; or posix_spawn, then exec. There are cases where we could report an IOException in ProcessBuilder.start() to the caller when the child process has actually been created successfully but where afterwards errors happened before the target exec(). This is by design.

      In those cases, since we throw an IOException, caller will never reap the process. How could he, he has no Process. In those cases Java_java_lang_ProcessImpl_forkAndExec is responsible for reaping the child process. We don't do this for all error paths, though.

      Affected are several paths when waiting for the liveness ping and when waiting for the exec error number.

            stuefe Thomas Stuefe
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: