-
Notifications
You must be signed in to change notification settings - Fork 253
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
infer_current_exe: Avoid picking non-path from maps #563
Conversation
Some ports are not showing paths in /proc/self/maps yet, so better make sure that we actually get a path before returning it, and fallback to current_exe() otherwise.
I think it may be more appropriate to simply introduce the appropriate |
Well, without a heading '/', it cannot be a path... |
Not saying it's making it a path, but that seems a reasonable check-up. |
Also, making it a cfg means that whenever a port happens to implement showing a path, they'll not only have to change the cfg to benefit from it, but also have to take care that the new backtrace source might be running on an old system that doesn't show the path (and thus get the breakage again...) |
It cannot be an absolute path. I don't like bets like "this code should be portable for different implementers of
There is a reason that Rust targets have a Linux kernel minimum and libc minimum and BSD OS minimums and other such things for various OS, yes, and there is also a reason that the parse function will have to have its internals entirely changed in #507 And in the future this code will likely be maintained by someone who has internalized the assumptions of some other operating system and they will apply their own reasoning, and they may unintentionally break this because a guard inserted for a target-specific reason was inserted without any indication of why in the source. And then people may or may not decide to inspect the git history. A |
I realize this may seem like pedantic rambling, I just don't want to get multiple successive PRs from Linux (which I think was the first implementer of Rust has gotten similar requests from people that want to claim their niche variant OS is a Linux target while heavily subsetting the Linux kernel UAPI (and thus libc implementation) we usually demand of Linux, and I gave a similar answer then: the diff may be small, but sometimes a small diff still matters for either performance or maintainability, so I prefer the |
If it wasn't an absolute path, it would be useless. |
superseded by #567 |
Some ports are not showing paths in /proc/self/maps yet, so better make sure that we actually get a path before returning it, and fallback to current_exe() otherwise.