Skip to content

Commit caf5010

Browse files
Merge #6976: fix: print compact stack traces if debug info is empty / not useful
c4971dc fix: use std::any_of (PastaPastaPasta) c760e44 fix: print compact stack traces if debug info is empty / not useful (pasta) Pull request description: ## Issue being fixed or feature implemented Sometimes we see "stack traces" like; ``` 2025-11-14T14:49:05Z Posix Signal: Segmentation fault 0#: (0xAF72A4F30718) <unknown-file> - ??? 1#: (0xF19AEAC3F8F8) <unknown-file> - ??? 2#: (0xF19AEAA4BA94) <unknown-file> - ??? 3#: (0xAF72A4F8CCE8) <unknown-file> - ??? 4#: (0xAF72A49C8FA4) <unknown-file> - ??? 5#: (0xAF72A460F7E0) <unknown-file> - ??? 6#: (0xF19AEA997400) <unknown-file> - ??? 7#: (0xF19AEA9974D8) <unknown-file> - ??? 8#: (0xAF72A462A410) <unknown-file> - ??? 2025-11-14T14:49:05Z Posix Signal: Trace/breakpoint trap 0#: (0xAF72A4F30718) <unknown-file> - ??? 1#: (0xF19AEAC3F8F8) <unknown-file> - ??? 2#: (0xF19AEA9971F0) <unknown-file> - ??? 3#: (0xAF72A4F30880) <unknown-file> - ??? 4#: (0xF19AEAC3F8F8) <unknown-file> - ??? 5#: (0xF19AEAA4BA94) <unknown-file> - ??? 6#: (0xAF72A4F8CCE8) <unknown-file> - ??? 7#: (0xAF72A49C8FA4) <unknown-file> - ??? 8#: (0xAF72A460F7E0) <unknown-file> - ??? 9#: (0xF19AEA997400) <unknown-file> - ??? 10#: (0xF19AEA9974D8) <unknown-file> - ??? 11#: (0xAF72A462A410) <unknown-file> - ??? Posix Signal: Segmentation fault 0#: (0xAF72A4F30718) <unknown-file> - ??? 1#: (0xF19AEAC3F8F8) <unknown-file> - ??? 2#: (0xF19AEAA4BA94) <unknown-file> - ??? 3#: (0xAF72A4F8CCE8) <unknown-file> - ??? 4#: (0xAF72A49C8FA4) <unknown-file> - ??? 5#: (0xAF72A460F7E0) <unknown-file> - ??? 6#: (0xF19AEA997400) <unknown-file> - ??? 7#: (0xF19AEA9974D8) <unknown-file> - ??? 8#: (0xAF72A462A410) <unknown-file> - ??? Posix Signal: Trace/breakpoint trap 0#: (0xAF72A4F30718) <unknown-file> - ??? 1#: (0xF19AEAC3F8F8) <unknown-file> - ??? 2#: (0xF19AEA9971F0) <unknown-file> - ??? 3#: (0xAF72A4F30880) <unknown-file> - ??? 4#: (0xF19AEAC3F8F8) <unknown-file> - ??? 5#: (0xF19AEAA4BA94) <unknown-file> - ??? 6#: (0xAF72A4F8CCE8) <unknown-file> - ??? 7#: (0xAF72A49C8FA4) <unknown-file> - ??? 8#: (0xAF72A460F7E0) <unknown-file> - ??? 9#: (0xF19AEA997400) <unknown-file> - ??? 10#: (0xF19AEA9974D8) <unknown-file> - ??? 11#: (0xAF72A462A410) <unknown-file> - ??? ``` This isn't helpful; if we have no useful info; let's print the compact format ## What was done? ## How Has This Been Tested? ## Breaking Changes ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK c4971dc kwvg: utACK c4971dc knst: utACK c4971dc Tree-SHA512: 89c6e2aa30b9168e186d680de38e60484aff2ef0f15e0f50e40ec9c298b4710ec2fa8b76b5fc4cff88220370e0fd666aa0124235cf446a00f18e7749b0a022e0
2 parents d3fa315 + c4971dc commit caf5010

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/stacktraces.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,13 @@ std::string GetCrashInfoStrFromSerializedStr(const std::string& ciStr)
469469

470470
static std::string GetCrashInfoStr(const crash_info& ci, size_t spaces)
471471
{
472-
if (ci.stackframeInfos.empty()) {
472+
// Check if we have any useful debug information at all
473+
// libbacktrace may return stackframe_info entries but with empty filenames and functions
474+
// when it can find the binary but can't resolve symbols
475+
bool hasUsefulInfo = std::any_of(ci.stackframeInfos.begin(), ci.stackframeInfos.end(),
476+
[](const auto& si) { return !si.filename.empty() || !si.function.empty(); });
477+
478+
if (!hasUsefulInfo) {
473479
return GetCrashInfoStrNoDebugInfo(ci);
474480
}
475481

0 commit comments

Comments
 (0)