Skip to content

ui/consts tests: failure on big endian hosts #98249

Closed as not planned
Closed as not planned
@awilfox

Description

@awilfox

I ran the Rust test suite on a 64-bit Power9 system (big-endian). The following failures were noted, all of which appear to be due to endianness:

ui/consts/issue-83182

diff of 64bit.stderr:
6	   |
7	   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
8	   = note: the raw bytes of the constant (size: 16, align: 8) {
-	               ╾───────alloc4────────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
+	               ╾───────alloc4────────╼ 00 00 00 00 00 00 00 01 │ ╾──────╼........
10	           }
11	
12	error: aborting due to previous error

The actual 64bit.stderr differed from the expected 64bit.stderr.

ui/consts/std/alloc

diff of 64bit.stderr:
6	   |
7	   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
8	   = note: the raw bytes of the constant (size: 16, align: 8) {
-	               00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 │ ................
+	               00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 │ ................
10	           }
11	
12	error: aborting due to previous error

The actual 64bit.stderr differed from the expected 64bit.stderr.

ui/constants/validate_never_arrays

diff of 64bit.stderr:
6	   |
7	   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
8	   = note: the raw bytes of the constant (size: 8, align: 8) {
-	               01 00 00 00 00 00 00 00                         │ ........
+	               00 00 00 00 00 00 00 01                         │ ........
10	           }
11	
12	error[E0080]: it is undefined behavior to use this value

17	   |
18	   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
19	   = note: the raw bytes of the constant (size: 16, align: 8) {
-	               01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 │ ................
+	               00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 01 │ ................
21	           }
22	
23	error[E0080]: it is undefined behavior to use this value

28	   |
29	   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
30	   = note: the raw bytes of the constant (size: 16, align: 8) {
-	               01 00 00 00 00 00 00 00 2a 00 00 00 00 00 00 00 │ ........*.......
+	               00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 2a │ ...............*
32	           }
33	
34	error: aborting due to 3 previous errors

The actual 64bit.stderr differed from the expected 64bit.stderr.

The fix would likely be the same as a theoretical fix to #89577. I would like to note the ub-* tests that failed in #89577 do fail here as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions