>From: ###@###.### (Christopher Lindblad)
Here is a little java program that creates a subprocess, waits for it to exit,
and then sends some data to it. Instead of an error being signalled when data
is sent through the broken pipe to the subprocess, the java runtime goes into
an infinite loop. I also have included a snippet of truss output to prove
that java is indeed looping.
public class process1 {
public static void main(String[] args) {
/* create a new process */
Process p = Runtime.getRuntime().exec("/bin/sh -c exit");
/* wait for it to exit */
p.waitFor();
/* now send data to it */
p.getOutputStream().write(new byte[1024]);
}
}
Error Message:
Log file:
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
....
Here is a little java program that creates a subprocess, waits for it to exit,
and then sends some data to it. Instead of an error being signalled when data
is sent through the broken pipe to the subprocess, the java runtime goes into
an infinite loop. I also have included a snippet of truss output to prove
that java is indeed looping.
public class process1 {
public static void main(String[] args) {
/* create a new process */
Process p = Runtime.getRuntime().exec("/bin/sh -c exit");
/* wait for it to exit */
p.waitFor();
/* now send data to it */
p.getOutputStream().write(new byte[1024]);
}
}
Error Message:
Log file:
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
write(4, "\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0".., 1024) Err#32 EPIPE
Received signal #13, SIGPIPE [ignored]
....