Skip to content
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

wrong exit code after ICE #116659

Closed
matthiaskrgr opened this issue Oct 12, 2023 · 3 comments · Fixed by #117557
Closed

wrong exit code after ICE #116659

matthiaskrgr opened this issue Oct 12, 2023 · 3 comments · Fixed by #117557
Labels
A-panic Area: Panicking machinery C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Oct 12, 2023

found while checking #116658 with

rustc 1.75.0-nightly (c1691db36 2023-10-11)
binary: rustc
commit-hash: c1691db366c0f2e2341c60377c248ca2d9335076
commit-date: 2023-10-11
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.2

When you run the snipped above with --edition, rustc panics, but the exit status is 1 as if there was just a normal compiler error, instead of a 101.

This tripped up automatic ice-reduction that relies on a somewhat familiar exit code when the program crashes 😅

@matthiaskrgr matthiaskrgr added the C-bug Category: This is a bug. label Oct 12, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 12, 2023
@fmease fmease added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-panic Area: Panicking machinery labels Oct 16, 2023
@Noratrieb
Copy link
Member

QueryResult::Poisoned => FatalError.raise(),

is the problematic line here that turns ICEs into "normal" fatal errors that call exit(1)

though actually at least with the non parallel compiler i'm very surprised that we're ending up in a query in the first place after panicking.

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 29, 2023
@matthiaskrgr matthiaskrgr added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Nov 1, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Nov 1, 2023
@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Nov 1, 2023

It seems that current stable does correctly exit with 101 here...

I bisected the exit code 101 -> exit code 1 change with a crashing file ( #117489 ) and got to

Regression in nightly-2023-08-31
Regression in 59a8294

#115144 cc @Zoxc / @compiler-errors

@apiraino
Copy link
Contributor

apiraino commented Nov 1, 2023

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Nov 1, 2023
@bors bors closed this as completed in d8dbf7c Nov 9, 2023
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Nov 15, 2023
Make `FatalErrorMarker` lower priority than other panics

This makes `FatalErrorMarker` lower priority than other panics in a parallel sections. If any other panics occur, they will be unwound instead of `FatalErrorMarker`. This ensures `rustc` will exit with the correct error code on ICEs.

This fixes rust-lang/rust#116659.
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Apr 7, 2024
Make `FatalErrorMarker` lower priority than other panics

This makes `FatalErrorMarker` lower priority than other panics in a parallel sections. If any other panics occur, they will be unwound instead of `FatalErrorMarker`. This ensures `rustc` will exit with the correct error code on ICEs.

This fixes rust-lang/rust#116659.
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
Make `FatalErrorMarker` lower priority than other panics

This makes `FatalErrorMarker` lower priority than other panics in a parallel sections. If any other panics occur, they will be unwound instead of `FatalErrorMarker`. This ensures `rustc` will exit with the correct error code on ICEs.

This fixes rust-lang/rust#116659.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-panic Area: Panicking machinery C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants