]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
global/signal_handler: behave if g_ceph_context or _log are null
authorSage Weil <sage@redhat.com>
Tue, 10 Jan 2017 03:52:02 +0000 (21:52 -0600)
committerSage Weil <sage@redhat.com>
Fri, 13 Jan 2017 16:40:53 +0000 (11:40 -0500)
This can happen if we trigger an assertion while g_ceph_context is being
torn down.

Signed-off-by: Sage Weil <sage@redhat.com>
src/global/signal_handler.cc

index 7d5069828c142a2d02b7d8b8c31a6ceb665751bf..e8f21c1610a149d9f2c6f1f24cdee882b95009d3 100644 (file)
@@ -113,7 +113,9 @@ static void handle_fatal_signal(int signum)
 
   // avoid recursion back into logging code if that is where
   // we got the SEGV.
-  if (!g_ceph_context->_log->is_inside_log_lock()) {
+  if (g_ceph_context &&
+      g_ceph_context->_log &&
+      !g_ceph_context->_log->is_inside_log_lock()) {
     // TODO: don't use an ostringstream here. It could call malloc(), which we
     // don't want inside a signal handler.
     // Also fix the backtrace code not to allocate memory.