From ffde56ccbae3531278e4287cabfd6529885b3274 Mon Sep 17 00:00:00 2001 From: Zuhaib Siddique Date: Fri, 22 May 2026 07:18:53 -0700 Subject: [PATCH] Ignore SIGPIPE at startup to prevent crashes on dropped printer connections (#13788) Ignore SIGPIPE at startup to prevent crash on dropped printer connection Writing to a closed printer network socket raised SIGPIPE, whose default action terminated the whole process (exit 141, no crash report). Set SIGPIPE to SIG_IGN once at main() entry (POSIX only) so such writes return EPIPE to the existing networking error handling instead of killing the app. Fixes #13787 --- src/OrcaSlicer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/OrcaSlicer.cpp b/src/OrcaSlicer.cpp index 880eaffa4b..7107e1ba1e 100644 --- a/src/OrcaSlicer.cpp +++ b/src/OrcaSlicer.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #if defined(__linux__) || defined(__LINUX__) #include @@ -7459,6 +7460,13 @@ extern "C" { #else /* _MSC_VER */ int main(int argc, char **argv) { +#ifndef _WIN32 + // Ignore SIGPIPE so a write to a closed socket (e.g. a dropped printer + // network connection) returns EPIPE to the caller instead of terminating + // the whole process. Without this, losing the printer link kills + // OrcaSlicer with SIGPIPE (exit 141) and produces no crash report. + std::signal(SIGPIPE, SIG_IGN); +#endif return CLI().run(argc, argv); } #endif /* _MSC_VER */