-
Bug
-
Resolution: Fixed
-
P4
-
17
-
b08
-
x86_64
-
linux
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8333038 | 17.0.12 | Aleksey Shipilev | P4 | Resolved | Fixed | b05 |
ADDITIONAL SYSTEM INFORMATION :
Ubuntu 21.10 / Debian GNU/Linux 10 (buster)
Java: 17.0.3/11.0.15
A DESCRIPTION OF THE PROBLEM :
When using ProcessBuilder.startPipeline the pipes (or pipe if only 2 ProcessBuilder instance used) created are never closed.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
the pipes created by ProcessBuilder.startPipeline are closed
ACTUAL -
the pipes created by ProcessBuilder.startPipeline are never closed
---------- BEGIN SOURCE ----------
List<ProcessBuilder> processBuilders = new LinkedList<>();
processBuilders.add(new ProcessBuilder("ls"));
processBuilders.add(new ProcessBuilder("grep", "a"));
List<Process> processes = ProcessBuilder.startPipeline(processBuilders);
Process last = processes.get(processes.size()-1);
last.waitFor();
try (InputStream inputStream = last.getInputStream()) {
inputStream.readAllBytes();
}
---------- END SOURCE ----------
FREQUENCY : always
Ubuntu 21.10 / Debian GNU/Linux 10 (buster)
Java: 17.0.3/11.0.15
A DESCRIPTION OF THE PROBLEM :
When using ProcessBuilder.startPipeline the pipes (or pipe if only 2 ProcessBuilder instance used) created are never closed.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
the pipes created by ProcessBuilder.startPipeline are closed
ACTUAL -
the pipes created by ProcessBuilder.startPipeline are never closed
---------- BEGIN SOURCE ----------
List<ProcessBuilder> processBuilders = new LinkedList<>();
processBuilders.add(new ProcessBuilder("ls"));
processBuilders.add(new ProcessBuilder("grep", "a"));
List<Process> processes = ProcessBuilder.startPipeline(processBuilders);
Process last = processes.get(processes.size()-1);
last.waitFor();
try (InputStream inputStream = last.getInputStream()) {
inputStream.readAllBytes();
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8333038 File descriptor leak with ProcessBuilder.startPipeline
- Resolved
- relates to
-
JDK-8290885 java/lang/ProcessBuilder/PipelineLeaksFD.java fail: More or fewer pipes than expected
- Closed
- links to
-
Commit openjdk/jdk17u-dev/d1e31f6f
-
Commit openjdk/jdk/620c8a04
-
Review openjdk/jdk17u-dev/2462
-
Review openjdk/jdk/9414
(1 links to)