Repository navigation
tools: remote-test-server: Fix UEFI crash return code - #164617
Conversation
Ayush1325
commented
Oct 20, 2026
- compiletest detects crash as an error code > 127.
- This does not work for UEFI, since UEFI errors are usize by default, and when converting to i32, we just remove the bits in middle. Eg: 0x8000000000000007 becomes 0x80000007
- So in case of crash, we get a negetive value as error instead of the expected signal when the host is linux.
- compiletest detects crash as an error code > 127. - This does not work for UEFI, since UEFI errors are usize by default, and when converting to i32, we just remove the bits in middle. Eg: 0x8000000000000007 becomes 0x80000007 - So in case of crash, we get a negetive value as error instead of the expected signal when the host is linux. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| #[cfg(target_os = "uefi")] | ||
| fn get_status_code(status: &ExitStatus) -> (u8, i32) { | ||
| let status = status.code().unwrap(); | ||
| if (status & i32::MIN) != 0 { (1, status & !i32::MIN) } else { (0, status) } |
There was a problem hiding this comment.
I think this is 'just' getting the sign bit, and if it's negative returning (1, positive value)?
Is there a reason we're not writing that more directly?
There was a problem hiding this comment.
Well, I wrote it this way to mirror what we do when constructing the error code in std:
rust/library/std/src/sys/process/uefi.rs
Line 252 in dc44e7f
I don't particularly mind changing it to just check for the sign, but this way of writing it kinda preserves that UEFI doesn't actuallly have an i32 error code. Just a code desguised as i32 (at least to me).
There was a problem hiding this comment.
Hm, okay, I guess that seems reasonable enough.
|
Reminder, once the PR becomes ready for a review, use |
|
@bors r+ |
…acrum tools: remote-test-server: Fix UEFI crash return code - compiletest detects crash as an error code > 127. - This does not work for UEFI, since UEFI errors are usize by default, and when converting to i32, we just remove the bits in middle. Eg: 0x8000000000000007 becomes 0x80000007 - So in case of crash, we get a negetive value as error instead of the expected signal when the host is linux.
…acrum tools: remote-test-server: Fix UEFI crash return code - compiletest detects crash as an error code > 127. - This does not work for UEFI, since UEFI errors are usize by default, and when converting to i32, we just remove the bits in middle. Eg: 0x8000000000000007 becomes 0x80000007 - So in case of crash, we get a negetive value as error instead of the expected signal when the host is linux.
…uwer Rollup of 6 pull requests Successful merges: - #164617 (tools: remote-test-server: Fix UEFI crash return code) - #164549 (feat!: change return type of `TryFromIntError::kind`) - #164893 (Add diagnostic items for env::vars / env::vars_os) - #164897 (Add regression test for CoerceShared impl with unnormalizable target) - #164908 (Add regression test for self referential inherent associated type ICE) - #164925 (Cleanup `rustdoc-html` tests)
Rollup of 6 pull requests Successful merges: - #164617 (tools: remote-test-server: Fix UEFI crash return code) - #164549 (feat!: change return type of `TryFromIntError::kind`) - #164893 (Add diagnostic items for env::vars / env::vars_os) - #164897 (Add regression test for CoerceShared impl with unnormalizable target) - #164908 (Add regression test for self referential inherent associated type ICE) - #164926 (Remove `type_array` from `rustc_codegen_ssa`)
Rollup merge of #164617 - Ayush1325:uefi-tests, r=Mark-Simulacrum tools: remote-test-server: Fix UEFI crash return code - compiletest detects crash as an error code > 127. - This does not work for UEFI, since UEFI errors are usize by default, and when converting to i32, we just remove the bits in middle. Eg: 0x8000000000000007 becomes 0x80000007 - So in case of crash, we get a negetive value as error instead of the expected signal when the host is linux.