-
Notifications
You must be signed in to change notification settings - Fork 257
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
Need to be able to reliably get symbol addrs #520
Comments
On macOS the function to get the address of the enclosing function of an ip address ( backtrace-rs/src/backtrace/libunwind.rs Line 58 in b3e5bb8
|
That's not too bad! Would |
The symbolization already does that. I wonder why |
If I had to guess, it's because it looks like |
|
It seems like everything is working as intended, then? Shall we close this? |
@workingjubilee Maaaybe? The comment here: backtrace-rs/src/backtrace/libunwind.rs Lines 58 to 68 in b3e5bb8
...uses the phrase "if this is fixed" — which suggests that something unwelcome (albeit not unknown) is happening here. Could we document this shortcoming? Or even make it explicit in the API by making
I almost would rather if backtrace-rs used the unreliable output |
Compact unwinding can be disabled when linking a binary or library, but when compact unwinding was enabled when linking (as is done for all system libraries and by default for user code), there are no DWARF unwinding tables remaining.
I did expect the current output to be useful for looking up in the symbol table which should always give the correct result if the symbol table exists at all. The result of |
(Whoops, edited my last comment because I got my function names mixed up.)
Am I right to think that you could instead use Alternatively, could backtrace-rs do that look-up into the symbol table? |
Right, you could.
I think that would make sense. |
Yeah, I think that kills the idea of using that on macOS dead. Any guess that might be wrong seems like it kinda breaks with what Regarding doing the table lookup implicitly, I don't think it should be completely off the (heh) table, but I'm slightly concerned about, and would like to hear an elaboration on, @philipc's perspective, namely:
I can guess why this was said, but it's likely there's a nuance that hasn't been stated explicitly and that might be missing from the conversation so far. |
I don't see any technical reason why the unwinder couldn't use the symbol table, but from a design perspective, this is something that the resolver is intended to do and already has code for, so I don't think it should be duplicated in the unwinder. I haven't seen a reason why the resolver can't be used in this case, but I haven't looked into the motivating use case (scoped-trace) at all. |
While I think the resolver should be used for this purpose, I don't think it works correctly currently. |
Returning None seems okay, at least, in the sense that it's useless but not wrong. But the DWARF response seems simply incorrect. |
Frame::symbol_address
.
This issue is no longer about |
Yes, that sounds great. Again, for context: In the scoped-trace crate, I use symbol address equality to capture backtraces with limited upper and lower unwinding bounds. So I'd like to be able to call this function without doing full symbol resolution, or in situation where only symbol tables are available and not full DWARF debuginfo. |
The documentation for
Frame::symbol_address
warns:Consequently, the following code 'works' on
x86_64-unknown-linux-gnu
, but not onaarch64-apple-darwin
:Is this expected behavior on this platform? If so, is there any way to work around this discrepancy?
In the scoped-trace crate, I use symbol address equality to capture backtraces with limited upper and lower unwinding bounds. I'm hoping to get this crate working on
aarch64-apple-darwin
.The text was updated successfully, but these errors were encountered: