-
Notifications
You must be signed in to change notification settings - Fork 247
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
Use /proc/self/maps when available instead of std::env::current_exe #488
Merged
alexcrichton
merged 9 commits into
rust-lang:master
from
pnkfelix:use-proc-self-maps-when-avail-instead-of-current-exe
Oct 25, 2022
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift click to select a range
3344386
standalone proc/self/maps parsing code to try instead of less reliabl…
pnkfelix 75d6b28
checkpoint regression test demonstrating failure of rust issue 101913.
pnkfelix 12f4fbc
fix code to work for cargo test --no-default-features .
pnkfelix 6a0b39d
fix test to ignore itself when it cannot invoke readelf.
pnkfelix b7bc9d0
Conditionalize 64-bit test. Add test that works for 32-bit targets.
pnkfelix b125d9c
placate cargo fmt.
pnkfelix cc0cdbb
switch to pure `Read` rather than `BufRead` based implementation, to …
pnkfelix 8dd32f0
Avoid using `str::split_once` method, since the MSRV is 1.42 but that…
pnkfelix 681ff30
placate cargo fmt.
pnkfelix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix code to work for cargo test --no-default-features .
- Loading branch information
commit 12f4fbc5161ec51b5bad11b8a695360b89fa388e
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic only applies to linux I think. Netbsd has
/proc/curproc/
. macOS doesn't have/proc
at all. As for other unixes I'm not quite sure.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to revise this so that only Linux pulls in the "interesting"
parse_maps
file, and every other target just goes to the no-op variant.(I was hoping that I had gotten the logic right such that targets that didn't have the
/proc/self/maps
pseudo-file, or if it failed to parse said file, it would silently just fall back onstd::env::current_exe
, but I haven't confirmed that yet.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked again, and realized that the sole calling module is solely defined here:
backtrace-rs/src/symbolize/gimli.rs
Lines 175 to 185 in 8b83ba1
That makes this a lot easier to limit to just these small subset of targets.
I force-pushed an update that fixes that (and backtraces my API to a simpler one now enabled by removing the
parse_running_mmaps_noop.rs
code).