-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Port the without_debuginfo test from backtrace-rs to the testsuite
#152860
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
ed55daa
e255ee5
a7b8152
2ee2332
f245f10
a2e9dad
a54b642
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| //@ compile-flags: -Cstrip=none -Cdebuginfo=none | ||
| //@ run-pass | ||
| #![feature(backtrace_frames)] | ||
| #![feature(backtrace_internals_accessors)] | ||
| use std::backtrace; | ||
|
|
||
| fn main() { | ||
| let mut missing_base_addresses = 0; | ||
| let btrace = backtrace::Backtrace::force_capture(); | ||
| let frames = btrace.frames(); | ||
| for frame in frames { | ||
| if frame.module_base_address().is_none() { | ||
| missing_base_addresses += 1; | ||
| } | ||
| } | ||
|
|
||
| if cfg!(windows) { | ||
| assert_eq!(missing_base_addresses, 0); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| //@ compile-flags: -Cstrip=none -Cdebuginfo=none | ||
| //@ run-pass | ||
| #![feature(backtrace_frames)] | ||
| #![feature(backtrace_internals_accessors)] | ||
| use std::backtrace; | ||
| fn main() { | ||
| let mut missing_symbols = 0; | ||
| let mut has_symbols = 0; | ||
| let btrace = backtrace::Backtrace::force_capture(); | ||
| let frames = btrace.frames(); | ||
| for frame in frames { | ||
| let mut any = false; | ||
| for sym in frame.symbols() { | ||
| if sym.name().is_some() { | ||
| any = true; | ||
| break; | ||
| } | ||
| } | ||
| if any { | ||
| has_symbols += 1; | ||
| } else if !frame.ip().is_null() { | ||
| missing_symbols += 1; | ||
| } | ||
| } | ||
|
|
||
| // FIXME(#346) currently on MinGW we can't symbolize kernel32.dll and other | ||
| // system libraries, which means we miss the last few symbols. | ||
| if cfg!(windows) && cfg!(target_env = "gnu") { | ||
| assert!(missing_symbols < has_symbols && has_symbols > 4); | ||
| } else { | ||
| assert_eq!(missing_symbols, 0); | ||
| } | ||
|
Comment on lines
+6
to
+43
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't a known problem, so we may need to determine how many frames are missing symbols and it may be aarch64-unknown-linux-gnu specific.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well it doesn't occur on my arm m2 mac so maybe it's specific? Might wanna check windows too to determine if it's x86
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Huuuh.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops I misread the target. Do you mind if I rerun the CI for x86 Linux to try to repro the problem?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @workingjubilee I added some debug info to try to find the frame with the missing info. Also could #152870 be relevant to this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's unclear in the current state to which "known problem" this discussion is referring to. Is it about I don't see how #152870 would be relevant in that context. |
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.