From 5eb32efb055aefce6cf6c4d20867762743150a10 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 27 Feb 2015 15:53:38 +0100 Subject: [PATCH] Fix crash in SocketEvents::ThreadProc fixes #8554 --- lib/base/socketevents.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/base/socketevents.cpp b/lib/base/socketevents.cpp index fdf49ee65..c490173ff 100644 --- a/lib/base/socketevents.cpp +++ b/lib/base/socketevents.cpp @@ -142,7 +142,15 @@ void SocketEvents::ThreadProc(void) VERIFY(ltref); } - desc.EventInterface->OnEvent(pfds[i].revents); + try { + desc.EventInterface->OnEvent(pfds[i].revents); + } catch (const std::exception& ex) { + Log(LogCritical, "SocketEvents") + << "Exception thrown in socket I/O handler:\n" + << DiagnosticInformation(ex); + } catch (...) { + Log(LogCritical, "SocketEvents", "Exception of unknown type thrown in socket I/O handler."); + } } delete [] pfds; -- 2.40.0