RFR: 8291986: ProcessBuilder.redirectErrorStream(true) leaves error stream available [v3]

Roger Riggs rriggs at openjdk.org
Thu Jan 15 13:19:50 UTC 2026


On Tue, 13 Jan 2026 21:47:40 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.
>
> Roger Riggs has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Some test platforms do not have `lsof` installed, if not available,
>    the tests are skipped.
>  - Remove extra -Xint test run, its purpose is unknown.

The refactored error reporting passed the CI multiple times.
If there are future failures, the new information will help diagnose the cause.

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

PR Comment: https://git.openjdk.org/jdk/pull/29143#issuecomment-3754752278


More information about the core-libs-dev mailing list