-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Unexpected nulls in debuginfo tests on windows-gnu #129662
Comments
This comment was marked as resolved.
This comment was marked as resolved.
The by-value-non-immediate-argument is #128973 Upon further inspection, I am now confident that the enums test failures are actually a change in layout with targets. Such nonsense is typical of the debuginfo tests. Take this example program, using the enum extracted from the test: enum NamedFields<'a> {
#[allow(dead_code)]
Droid { id: i32, range: i64, internals: &'a isize },
Void
}
fn main() {
let e = NamedFields::Void;
unsafe {
#[cfg(target_pointer_width = "32")]
{
let words = std::mem::transmute::<NamedFields, [std::mem::MaybeUninit<u8>; 16]>(e);
println!("{:?}", words[12].assume_init());
}
#[cfg(target_pointer_width = "64")]
{
let words = std::mem::transmute::<NamedFields, [std::mem::MaybeUninit<u8>; 24]>(e);
println!("{:?}", words[0].assume_init());
}
}
} Which we can run on any target that can print using Miri x86_64-pc-windows-msvc, x86-64-pc-windows-gnu, and x86_64-unknonw-linux-gnu all print 1. So I think the debuggers in the tests are correctly reporting that the discriminant value for |
Oh I see!
As far as I can tell, this test has been broken since it was written. You can't rely on field order like this, and indeed as I demonstrated above, fields get reordered differently across targets. The structs and enums also have different field ordering on a single target. |
Rollup merge of rust-lang#129672 - saethlin:enum-debuginfo-tests, r=Mark-Simulacrum Make option-like-enum.rs UB-free and portable Fixes rust-lang#129662 (or, at least the parts of it that aren't rust-lang#128973)
…acrum Make option-like-enum.rs UB-free and portable Fixes rust-lang/rust#129662 (or, at least the parts of it that aren't rust-lang/rust#128973)
…acrum Make option-like-enum.rs UB-free and portable Fixes rust-lang/rust#129662 (or, at least the parts of it that aren't rust-lang/rust#128973)
Since #119229 GDB used on CI is recent enough to run the new tests.
However, there are three failures that have been ignored in #119229:
tests\debuginfo\method-on-enum.rs
(happened only on 32-bits)tests\debuginfo\option-like-enum.rs
(happened only on 32-bits)tests\debuginfo\by-value-non-immediate-argument
The text was updated successfully, but these errors were encountered: