CBL-8057: Better stack trace logging and crash handling#2490
Merged
Conversation
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.
It is on by default, and the API that used to turn it on was removed
Temp test to get the fix for Android downstream
|
Code Coverage Results:
|
pasin
reviewed
May 28, 2026
Collaborator
pasin
left a comment
There was a problem hiding this comment.
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?
Collaborator
|
From LiteCore channel, seem like it needs to go in because of the change in fleece. |
pasin
approved these changes
May 28, 2026
Member
Author
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. |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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