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

LLVM assertion failures hang with a modal dialog on Windows #92829

Closed
hkratz opened this issue Jan 12, 2022 · 3 comments · Fixed by #93402
Closed

LLVM assertion failures hang with a modal dialog on Windows #92829

hkratz opened this issue Jan 12, 2022 · 3 comments · Fixed by #93402
Labels
O-windows Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@hkratz
Copy link
Contributor

hkratz commented Jan 12, 2022

The Windows CI build with LLVM assertions enabled recently hung without an error message. It turned out to be an LLVM assertion failure resulting in a dialog which needed to be acknowledged, see #92535 (comment).

According to the assert documentation such a dialog is always displayed, but that is not the whole truth. Apparently _CrtSetReportHook() can be used to customize assertion failure handling. We should definitely make assertions failures exit with error after printing failure information to stderr instead of displaying a dialog and hanging.

@rustbot label O-windows

@rustbot rustbot added the O-windows Operating system: Windows label Jan 12, 2022
@cuviper cuviper added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 12, 2022
@Patrick-Poitras
Copy link
Contributor

Could this be part of why we're getting so many hangs in the CI?

@hkratz
Copy link
Contributor Author

hkratz commented Jan 14, 2022

@Patrick-Poitras That was responsible for four stuck dist-x86_64-msvc-alt builds recently. I don't think it was responsible for many timed out builds before that.

@ehuss
Copy link
Contributor

ehuss commented Jan 28, 2022

Posted #93402 with a possible solution.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 3, 2022
Windows: Disable LLVM crash dialog boxes.

This disables the crash dialog box on Windows. When LLVM hits an assertion, it will open a dialog box with Abort/Retry/Ignore. This is annoying on CI because CI will just hang until it times out (which can take hours).

Instead of opening a dialog box, it will print a message like this:

```
Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!", file D:\Proj\rust\rust\src\llvm-project\llvm\include\llvm/Support/Casting.h, line 255
```

Closes rust-lang#92829
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 3, 2022
Windows: Disable LLVM crash dialog boxes.

This disables the crash dialog box on Windows. When LLVM hits an assertion, it will open a dialog box with Abort/Retry/Ignore. This is annoying on CI because CI will just hang until it times out (which can take hours).

Instead of opening a dialog box, it will print a message like this:

```
Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!", file D:\Proj\rust\rust\src\llvm-project\llvm\include\llvm/Support/Casting.h, line 255
```

Closes rust-lang#92829
@bors bors closed this as completed in f7e0f97 Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows 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.

5 participants