Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile: Fix checks of remaining backtrace buffer #36006

Merged
merged 1 commit into from
Nov 6, 2020

Conversation

kimikage
Copy link
Contributor

@kimikage kimikage commented May 23, 2020

Fixes #35870

jl_unw_stepn requires a free space of JL_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 adds jl_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.

@kimikage kimikage force-pushed the issue35870 branch 2 times, most recently from c67a6e4 to 7e86951 Compare May 24, 2020 02:46
@kimikage kimikage marked this pull request as ready for review May 24, 2020 02:47
src/signal-handling.c Outdated Show resolved Hide resolved
@kimikage
Copy link
Contributor Author

I'll close this as there are other PRs which modify the Profile.

@kimikage
Copy link
Contributor Author

kimikage commented Nov 6, 2020

I've rebased the commit and am re-opening this PR.
However, I'm not familiar with the C and I still don't understand the current codebase.

cc: @vtjnash

@kimikage kimikage reopened this Nov 6, 2020
@kimikage kimikage force-pushed the issue35870 branch 2 times, most recently from eacf725 to 54c2d95 Compare November 6, 2020 02:58
@kimikage kimikage changed the title Fix checks of remaining backtrace buffer Profile: Fix checks of remaining backtrace buffer Nov 6, 2020
@vtjnash vtjnash merged commit 5d68779 into JuliaLang:master Nov 6, 2020
@kimikage kimikage deleted the issue35870 branch November 6, 2020 23:54
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.

Condition where backtrace buffer for profiling is full
2 participants