in reply to SIGPIPE not trapped after sleep in CGI
Try to add following two lines after print "output #2\n";:
sleep 5; print "output #3\n"; [download]
Update: