Gnutls should use MSG_NOSIGNAL when writing to a socket
Instead of send() or writev() with no flags, it should call send() or sendmsg() with the MSG_NOSIGNAL flag set. This would prevent the kernel from raising SIGPIPE when writing to a socket whose write end has been shutdown.
Not doing this requires client applications to go through lengths to avoid this situation. Or, more likely, they don't handle this at all, which means they can get accidentally killed in some corner cases. (This happened to FFmpeg/Libav.)