diff --git a/src/stacktraces.cpp b/src/stacktraces.cpp index 3f6262108c97f..26283eb231097 100644 --- a/src/stacktraces.cpp +++ b/src/stacktraces.cpp @@ -469,7 +469,13 @@ std::string GetCrashInfoStrFromSerializedStr(const std::string& ciStr) static std::string GetCrashInfoStr(const crash_info& ci, size_t spaces) { - if (ci.stackframeInfos.empty()) { + // Check if we have any useful debug information at all + // libbacktrace may return stackframe_info entries but with empty filenames and functions + // when it can find the binary but can't resolve symbols + bool hasUsefulInfo = std::any_of(ci.stackframeInfos.begin(), ci.stackframeInfos.end(), + [](const auto& si) { return !si.filename.empty() || !si.function.empty(); }); + + if (!hasUsefulInfo) { return GetCrashInfoStrNoDebugInfo(ci); }