in reply to perl dying without a trace

If it means anything. I have the same exact same issue:
#perl, v5.8.8 built for x86_64-linux-thread-multi _debug( "WRITE to sock (" . length($tmData) . ")); my $bytesWrote = $itosSock->syswrite($tmData); #perl signals SIGPIPE with a return code 141 (will not execute the nex +t line) _debug( "WROTE ($bytesWrote) to sock" ); # I use socat as the client-side and it closes.
Looking for a work around or fix.

Replies are listed 'Best First'.
Re^2: perl dying without a trace
by Crackers2 (Parson) on Oct 30, 2013 at 19:04 UTC

    See my response to diatolevi. You have to add a SIGPIPE handler to your code.

    Mine is as simple as:

    $SIG{PIPE} = sub { print STDERR "SIGPIPE @_\n"; };

    Which basically just ignores the SIGPIPE and leaves it to you to handle the error after the syswrite