Skip to content

CBL-8057: Better stack trace logging and crash handling#2490

Merged
borrrden merged 10 commits into
masterfrom
feature/cbl-8057_stack_trace
May 28, 2026
Merged

CBL-8057: Better stack trace logging and crash handling#2490
borrrden merged 10 commits into
masterfrom
feature/cbl-8057_stack_trace

Conversation

@borrrden
Copy link
Copy Markdown
Member

@borrrden borrrden commented May 26, 2026

It's almost impossible to have a release build that properly prints out stack traces at runtime with frame names and such. This adds the relative address of the frame to the stack trace log so that it can be looked up after the fact, and also adds a new crash log that prints a stack trace to a special file in the event of a crash.

As a side effect of updating Fleece this also fixes CBL-8363

It's almost impossible to have a release build that properly prints out stack traces at runtime with frame names and such.  This adds the relative address of the frame to the stack trace log so that it can be looked up after the fact, and also adds a new crash log that prints a stack trace to a special file in the event of a crash.
@borrrden borrrden requested review from jianminzhao and pasin May 26, 2026 05:49
@cbl-bot
Copy link
Copy Markdown

cbl-bot commented May 27, 2026

Code Coverage Results:

Type Percentage
branches 64.5
functions 77.37
instantiations 70.95
lines 75.95
regions 72.22

Copy link
Copy Markdown
Collaborator

@pasin pasin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Earlier this week in Slack, you mentioned that this likely wouldn't be included in 4.1.0 because it was probably too late. Has that decision changed?

@pasin
Copy link
Copy Markdown
Collaborator

pasin commented May 28, 2026

From LiteCore channel, seem like it needs to go in because of the change in fleece.

Comment thread LiteCore/Logging/LogFiles.cc
@borrrden
Copy link
Copy Markdown
Member Author

Earlier this week in Slack, you mentioned that this likely wouldn't be included in 4.1.0 because it was probably too late. Has that decision changed?

Yes, my hand is kind of forced because it's already on Fleece master so I either have to keep going or back out. The thing definitely not going into 4.1.0 is the std::filesystem stuff.

borrrden added 2 commits May 28, 2026 15:50
Despite passing on github actions, the older CI machine can still fail to use libbacktrace properly.  Rather than crash just give up on the frame resolution in that case.
@borrrden borrrden merged commit da8b054 into master May 28, 2026
9 checks passed
@borrrden borrrden deleted the feature/cbl-8057_stack_trace branch May 28, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants