]> granicus.if.org Git - icinga2/commitdiff
Fix crash in SocketEvents::ThreadProc
authorGunnar Beutner <gunnar@beutner.name>
Fri, 27 Feb 2015 14:53:38 +0000 (15:53 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Fri, 27 Feb 2015 14:53:38 +0000 (15:53 +0100)
fixes #8554

lib/base/socketevents.cpp

index fdf49ee65665181dd04c3d54714cb907445f161c..c490173ff9c22b58f42fb106b404d08376d8d16f 100644 (file)
@@ -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;