Integrated: 8291986: ProcessBuilder.redirectErrorStream(true) leaves error stream available

Roger Riggs rriggs at openjdk.org
Thu Jan 15 15:57:47 UTC 2026


On Fri, 9 Jan 2026 17:46:45 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> On Linux and Mac, when a process is started, pipes are created to communicate with the child.
> In the case where the stderr is redirected to stdout using `ProcessBuilder.redirectErrorStream()`, the pipe is not needed and should not be created.
> 
> Added a test to check pipe creation when spawning with and without `redirectErrorStream(t/f)`. 
> Rewrote the extraction of pipes to use `lsof` available on Mac and Linux. (previously used Linux /proc/pid/fd/...)
> Converted PipelineLeaksFD test to JUnit.

This pull request has now been integrated.

Changeset: 203eb701
Author:    Roger Riggs <rriggs at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/203eb70110dd546784e03243bf98ff3ddb407030
Stats:     230 lines in 3 files changed: 184 ins; 2 del; 44 mod

8291986: ProcessBuilder.redirectErrorStream(true) leaves error stream available

Reviewed-by: jpai

-------------

PR: https://git.openjdk.org/jdk/pull/29143


More information about the core-libs-dev mailing list