Profile: Fix checks of remaining backtrace buffer #36006
Merged
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.
Fixes #35870
jl_unw_stepn
requires a free space ofJL_BT_MAX_ENTRY_SIZE + 1
regardless of the actual entry size. Therefore, the tail of the backtrace buffer is eventually filled with sentinel, i.e.0
.It is necessary to export
JL_BT_ MAX_ENTRY_SIZE
to detect the buffer fullness in the Profile package. For this reason, and in order to commonize the code between OSs, this PR addsjl_profile_is_buffer_full()
.Edit:I don't feel that this change is as simple as the problem which this fixes (i.e. the display of a warning).Therefore, hoping that the backtrace handling will be radically improved in the future, I think that it is enough to add a broken test for now.