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

rustc panic on unwrap in rustc_codegen_llvm::llvm::diagnostic::Diagnostic::unpack when using custom target #55216

Closed
thepowersgang opened this issue Oct 20, 2018 · 2 comments
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.

Comments

@thepowersgang
Copy link
Contributor

When using this custom target to compile libcore (and I'd assume any other crate), rustc ICEs on an unwrap in the above named function.

This unwrap at diagnostic.rs:88 seems to be only able to fail if there's a null reference in LLVM (or in the rustc shim)

@csmoe csmoe added A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. labels Oct 20, 2018
@thepowersgang
Copy link
Contributor Author

Correction: The original diagnosis was wrong, the crash is in InlineAsmDiagnostic::unpack. it's expecting instruction to be non-None/null, but LLVM appears to permit this to be nullptr

Reference:

@nikic
Copy link
Contributor

nikic commented Nov 26, 2018

There was an attempt to fix this at #55193, which ran into an assertion on Windows.

bors added a commit that referenced this issue Mar 25, 2019
make asm diagnostic instruction optional

`DiagnosticInfoInlineAsm::getInstruction` may return a null pointer, so
the instruction shouldn't be blindly unwrapped.

Reopening from #55193. I was unable to trigger the assertion on Windows after rebasing.

Fixes #23458.
Fixes #55216.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
Projects
None yet
Development

No branches or pull requests

3 participants