]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/crash: behave when posted crash has no backtrace 31643/head
authorSage Weil <sage@redhat.com>
Thu, 14 Nov 2019 16:28:47 +0000 (10:28 -0600)
committerSage Weil <sage@redhat.com>
Thu, 14 Nov 2019 16:28:47 +0000 (10:28 -0600)
This is the case when the qa/tasks/mgr/test_crash.py test runs, and could
happen in the real world too, perhaps, if someone fed us wonky input.

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/crash/module.py

index 4cbe1641d4651d14e138f17ee3f460047f931374..34128b93c238afa8bb0be617d59f7c36271555da 100644 (file)
@@ -181,7 +181,8 @@ class Module(MgrModule):
             metadata = self.validate_crash_metadata(inbuf)
         except Exception as e:
             return errno.EINVAL, '', 'malformed crash metadata: %s' % e
-        metadata['stack_sig'] = self.calc_sig(
+        if 'backtrace' in metadata:
+            metadata['stack_sig'] = self.calc_sig(
                 metadata.get('backtrace'), metadata.get('assert_msg'))
         crashid = metadata['crash_id']