From: Kefu Chai Date: Wed, 30 Sep 2020 05:51:03 +0000 (+0800) Subject: common/BackTrace: print path without symbol X-Git-Tag: v16.1.0~922^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37487%2Fhead;p=ceph.git common/BackTrace: print path without symbol before ea6abcf34c11c80dec507f7dee8babd26440196c, we have 2: (()+0x14140) [0x7f4462af6140] after ea6abcf34c11c80dec507f7dee8babd26440196c, we have 2: () after this change, we have 2: /lib/x86_64-linux-gnu/libpthread.so.0(+0x14140) [0x7f7137e2f140] Signed-off-by: Kefu Chai --- diff --git a/src/common/BackTrace.cc b/src/common/BackTrace.cc index e6396afe3a73..42a8da2aebd1 100644 --- a/src/common/BackTrace.cc +++ b/src/common/BackTrace.cc @@ -46,7 +46,7 @@ std::string BackTrace::demangle(const char* name) end = j; } } - if (begin && end) { + if (begin && end && begin < end) { std::string mangled(begin, end); int status; // only demangle a C++ mangled name