-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
dtrace's ustack() function cannot unwind stack frames on FreeBSD since 1.56.0 #97723
Comments
Without it, ever since rustc 1.56.0 dtrace's ustack() function cannot unwind stack frames. rust-lang/rust#97723
Does it still fail if you set |
triage note: this is most likely unrelated to debuginfo. Usual mechanisms for unwinding are uwtables or frame pointers, both mechanisms are independent of debuginfo. @rustbot label -A-debuginfo |
Yes, it still fails if I use |
And if you br/bt in a similar location in gdb or use other unwinding implementations? |
Yes, gdb can print stack traces even without a custom |
So the short summary is basically: something changed in how we emit the uwtables between 1.55 and 1.56. uwtables are clearly still “valid”, at least for the purposes of the unwinder used by gdb, but not so for the purposes of whatever unwinding implementation dtrace uses. Ultimately it is LLVM that's emitting the tables so…
|
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. @rustbot label -I-prioritize +P-medium |
One of the best ways to profile Rust code is with dtrace, as described at https://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html#DTrace . As recently as Rust 1.55.0 that worked fine. But with Rust 1.56.0 the stack just isn't there. Dtrace can only see a single Rust-level stack frame. For example:
Code
With Rust 1.55.0
With Rust 1.56.0
Version it worked on
It most recently worked on: Rust 1.55.0
Version with regression
Workaround
The old behavior can be restored by compiling with
RUSTFLAGS="-C force-frame-pointers"
. This flag was added by #48785 , but that was a long time ago. There is nothing in the 1.56.0 release notes, nor any recent commit messages, that mention anything about frame pointers. Was this change therefore accidental? Or could it have been a by product of switching to LLVM 13?The text was updated successfully, but these errors were encountered: