Fornax and SIGPIPE
How does Fornax handle SIGPIPE? One of the reasons I've got relatively complicated netcode in libpxd is for managing SIGPIPE without globally ignoring it or masking it before SSL calls - and I have gotten them before in strange situations, particularly from SSL_shutdown. Fornax doesn't seem to handle SIGPIPE in any way, but it also doesn't do anything special with the SSL objects like I do in libpxd, so I'm curious where the magic is.
2025-09-19 ยท 8 months ago
5 Comments โ
๐ stack [mod] ยท 2025-09-19 at 15:18:
@ingrix, I have not looked at it yet. Ignorance is bliss until someone points it out! Thank you for bringing it to my attention.
๐ ingrix [OP] ยท 2025-09-19 at 15:22:
@stack so Fornax does seem to be very resistant to catching a SIGPIPE, but I have in the last couple of minutes since posting my question managed to trigger one. I'm not sure exactly how, I haven't been able to reproduce it yet. I guess it seems your particular flow of interactions between epoll() and OpenSSL works particularly well or something. If I can figure out how I did it I'll let you know.
๐ stack [mod] ยท 2025-09-19 at 18:26:
@ingrix, I've been looking at SIGPIPE, and decided to just SIG_IGN it. I tried to be very careful checking for socket errors, and I haven't experienced SIGPIPE issues yet. We'll see what happens.
๐ ingrix [OP] ยท 2025-09-19 at 18:55:
@stack that's certainly the safest bet, and the way that most server's I have seen handle it. I have still not reproduced the SIGPIPE so whatever magic you are conjuring is pretty good, but no sense risking a fatal signal. (Edit: typo)
๐ stack [mod] ยท 2025-09-19 at 19:01:
@ingrix -- Be aware that I just pushed a lot of changes to the repo... There are two test servers running on ports 10965 and 10966, with the newest code.