One trick I used is to run the program under straceor ltrace(or attach to a process with strace). Naturally, it was under Linux. On other operating systems, you should use ktraceeither dtraceor whatever.
, , , - FIFO , 10K ( SIGPIPE SIGHUP, . ( , , , ).
, ... , .