This is a record of a simple test that uses netcat, spiped, and spipe. The test program is a Perl script that does the following: - create a 256-bit random key file - fork a netcat child that listens on port 8086 - fork an spiped child that listens for encrypted connections on port 6502 and forwards them to the (plaintext) netcat on port 8086 - fork an spipe child that connects to the spiped on port 6502; this should trigger the following chain of events: - spipe connects to spiped on port 6502 and waits for I/O on the socket or its own standard input - spiped creates a connection to netcat on port 8086 and waits for I/O on either side of the forwarded connection - netcat accepts the connection and waits for I/O on the socket or its own standard input - write a line of text to netcat's standard input; this should make: - netcat forward this line to the connection from spiped - spiped forward this line to the connection from spipe - spipe output this line to its standard output - close the pipe to netcat; this should make: - netcat exit and close the connection from spiped - spiped close the connection from spipe - spipe exit... possibly immediately, before the line from the previous point has actually been written to its standard output! - read a line of text from spipe's standard output In a repeated execution of this test tool, every now and then spipe exits before its pushbits thread manages to complete the write to stdout. This may be seen in the log file; it has the strace output for the Perl test tool and all of its children. The really important part is the trace of process 13020 (the main strace thread) and process 13021 (the pushbits/forwarding thread); the main thread writes "mellon\n" to the internal pipe and then calls exit_group() (Linux threads's way of terminating the whole process and all of its threads) before process 13021 has managed to read it back and forward it. This is at the very end of the logfile. Note that due to the stdout/stderr intermingling and buffering, the actual error message "Could not read from the spipe child:" precedes the "spipe started" and "Wrote 'mellon'" messages; the strace log shows that the Perl script did these things in the correct order.