Java Bugs - exec bug

The error stream of an exec'd process is not reliably accessible.

This program demonstrates two bugs with the error stream of an exec'd Process.

What the program tries to do is exec a subprocess that writes something to stderr; read that text from the subprocess's error stream and echo it to System.err; and display the return value of the subprocess.

What happens instead, when run using Solaris JDK 1.0.2:

This bug is fixed in JDK 1.1.

View the source code.

% java Bugs.ExecBug
err = 1!
cat: cannot open /felen=-2
	at ExecBug.main(

Back to bugs.
Back to ACME Java.
Back to ACME Labs.