From f5b197df930550192fd09a11d780b4ff0ebbf815 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 14 Nov 2019 10:28:47 -0600 Subject: [PATCH] mgr/crash: behave when posted crash has no backtrace 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 --- src/pybind/mgr/crash/module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/crash/module.py b/src/pybind/mgr/crash/module.py index 4cbe1641d4651..34128b93c238a 100644 --- a/src/pybind/mgr/crash/module.py +++ b/src/pybind/mgr/crash/module.py @@ -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'] -- 2.39.5