From: Sage Weil Date: Tue, 10 Jan 2017 03:52:02 +0000 (-0600) Subject: global/signal_handler: behave if g_ceph_context or _log are null X-Git-Tag: v12.0.0~170^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d1cc9e4836b7d360ccb3dcd129c4799508e41e51;p=ceph.git global/signal_handler: behave if g_ceph_context or _log are null This can happen if we trigger an assertion while g_ceph_context is being torn down. Signed-off-by: Sage Weil --- diff --git a/src/global/signal_handler.cc b/src/global/signal_handler.cc index 7d5069828c14..e8f21c1610a1 100644 --- a/src/global/signal_handler.cc +++ b/src/global/signal_handler.cc @@ -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.