-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Test by-value-self-argument-in-trait-impl.rs
fails on aarch64
#49807
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
Comments
@alexcrichton could that be related to updating to LLVM6? |
Perhaps! Especially if it's the 24 -> 25 release |
Did you see something similar before? |
Our CI does not run aarch64 tests, so this would not have been caught. This is likely an LLVM bug or a rustc bug |
Your CI test aarch64 as well: https://travis-ci.org/rust-lang/rust/builds/365338238?utm_source=github_status&utm_medium=notification |
We also use the bundled llvm that comes with rust. |
@Mic92 we're not running tests for aarch64, just building binaries |
Off-topic/tangent: I agree it seems better to disable all tests on aarch64 in nixpkgs. I think such test-fixing efforts should "start upstream". Nixpkgs probably doesn't have enough knowledge (human resources) to spearhead this, and even if we did, it would better be approached in a different way, e.g. testing and fixing before rustc is released, etc. (No blaming meant, just stating.) More thoughts on this? |
No, I'm also for disabling the tests on aarch64 in nixpkgs :) |
done in NixOS/nixpkgs#39000 |
With a breakpoint at by-value-self-argument-in-trait-impl.rs:82:
Observe that running "print self" dumps what appears to be the contents of x0 - x3. The procedure call standard for AArch64 says that in this case, the first parameter (self) will be passed as a pointer to caller allocated memory in x0, rather than being passed by value in registers. We can verify that this is actually the case:
(These are the values expected - 0x40b15c8000000000 = 4444.5, 0x15b3 = 5555, 0x1a0a = 6666, 0x40be618000000000 = 7777.5). As expected, register x0 appears to be pointing to |self|, so this suggests there's a bug in the DWARF symbols. Looking out the output of objdump -e, you can see: In .debug_info:
DW_AT_type is the correct type:
But DW_AT_location doesn't look quite right. From the .debug_loc section:
DW_OP_reg0 says that the location of |self| is x0, but x0 contains a pointer to the location. Shouldn't the "DW_OP_reg0" be "DW_OP_breg0: 0" instead? |
I've done some investigation on this for Red Hat bugs, and found it to be an issue with GlobalISel.
If you add |
This also reminds me of #47611, where we needed to stop adding an explicit |
I have a potential LLVM fix here: https://bugzilla.redhat.com/show_bug.cgi?id=1625768#c2 |
Summary: D31439 changed the semantics of dbg.declare to take the address of a variable as the first argument, making it indirect. It specifically updated FastISel for this change here: https://reviews.llvm.org/D31439#change-WVArzi177jPl GlobalISel needs to follow suit, or else it will be missing a level of indirection in the generated debuginfo. This problem was seen in a Rust debuginfo test on aarch64, since GlobalISel is used at -O0 for aarch64. rust-lang/rust#49807 https://bugzilla.redhat.com/show_bug.cgi?id=1611597 https://bugzilla.redhat.com/show_bug.cgi?id=1625768 Reviewers: dblaikie, aprantl, t.p.northover, javed.absar, rnk Reviewed By: rnk Subscribers: #debug-info, rovka, kristof.beyls, JDevlieghere, llvm-commits, tstellar Differential Revision: https://reviews.llvm.org/D51749 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341969 91177308-0d34-0410-b5e6-96231b3b80d8
Summary: D31439 changed the semantics of dbg.declare to take the address of a variable as the first argument, making it indirect. It specifically updated FastISel for this change here: https://reviews.llvm.org/D31439#change-WVArzi177jPl GlobalISel needs to follow suit, or else it will be missing a level of indirection in the generated debuginfo. This problem was seen in a Rust debuginfo test on aarch64, since GlobalISel is used at -O0 for aarch64. rust-lang/rust#49807 https://bugzilla.redhat.com/show_bug.cgi?id=1611597 https://bugzilla.redhat.com/show_bug.cgi?id=1625768 Reviewers: dblaikie, aprantl, t.p.northover, javed.absar, rnk Reviewed By: rnk Subscribers: #debug-info, rovka, kristof.beyls, JDevlieghere, llvm-commits, tstellar Differential Revision: https://reviews.llvm.org/D51749 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341969 91177308-0d34-0410-b5e6-96231b3b80d8
…alexcrichton Update LLVM to fix GlobalISel dbg.declare Fixes rust-lang#49807.
Hi,
the
by-value-self-argument-in-trait-impl.rs
test fails for NixOS when compiling for aarch64 with the following output:The full output can be found here (error is at the end).
The third gdb command prints:
$3 = (1.3906711614819425e-309, 3333, 281474976693728, 1.390671161483405e-309)
while the following is expected:
$3 = (4444.5, 5555, 6666, 7777.5)
There is clearly something going on, but I don't have any idea what that could be. I also don't have any access to an aarch64 build machine to debug this problem.
The text was updated successfully, but these errors were encountered: