branch-4.1: [Enhancement](BE) Make print stack API more stable #64093#65284
Open
zclllyybb wants to merge 1 commit into
Open
branch-4.1: [Enhancement](BE) Make print stack API more stable #64093#65284zclllyybb wants to merge 1 commit into
zclllyybb wants to merge 1 commit into
Conversation
Issue Number: close apache#62497 follow up apache#64454 This PR adds a safer BE print stack API based on libunwind signal-context unwinding. Stack unwinding may call `dl_iterate_phdr()` to find DWARF/FDE metadata. In signal-based stack capture, jemalloc profiling, or concurrent `dlopen()` / `dlclose()`, re-entering glibc's loader-lock path may deadlock or become unsafe. Route GNU libunwind's PHDR lookup through Doris' lock-free PHDR cache. The signal handler unwinds from the kernel-provided signal context, while libunwind reads loaded-object metadata from Doris' PHDR snapshot instead of calling glibc `dl_iterate_phdr()` directly. Normal code paths still use the original live `dl_iterate_phdr()` behavior. The research project is at https://github.com/JoverZhang/Doris-BE-Print-Stack-API-Research Co-authored-by: zhaochangle <zhaochangle@selectdb.com> (cherry picked from commit dc70115)
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
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.
Proposed changes
Backport the stack trace API stability enhancement to
branch-4.1.This PR includes:
#64093/dc70115: make the print stack API more stable#64454/0141aa2is already present onbranch-4.1, so this PR does not duplicate it.Validation
./build.sh --becompleted successfully in thebranch-4.1worktreegit diff --check upstream/branch-4.1..HEADpassed#64454