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

Unexpected non-scalars in outputs of asm! cause rustc to dump core #37435

Closed
cbiffle opened this issue Oct 27, 2016 · 3 comments
Closed

Unexpected non-scalars in outputs of asm! cause rustc to dump core #37435

cbiffle opened this issue Oct 27, 2016 · 3 comments
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. requires-nightly This issue requires a nightly compiler in some way.

Comments

@cbiffle
Copy link
Contributor

cbiffle commented Oct 27, 2016

Unexpected non-scalars in outputs of asm! cause rustc to dump core. (Doing this inputs causes a different problem; see #37433).

To reproduce:

#![feature(asm)]

fn main() {
    unsafe {
        asm!("" : "=r"(""));
    }
}

I get:

rustc: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/llvm/lib/IR/InlineAsm.cpp:46: llvm::InlineAsm::InlineAsm(llvm::FunctionType*, const string&, const string&, bool, bool, llvm::InlineAsm::AsmDialect): Assertion `Verify(getFunctionType(), constraints) && "Function type not legal for constraints!"' failed.
Aborted (core dumped)

Meta

rustc --version --verbose:
rustc 1.14.0-nightly (c59cb71 2016-10-26)
binary: rustc
commit-hash: c59cb71
commit-date: 2016-10-26
host: x86_64-unknown-linux-gnu
release: 1.14.0-nightly
LLVM version: 3.9

No backtrace was produced (core dumped).

@TimNN TimNN added A-inline-assembly Area: Inline assembly (`asm!(…)`) I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. labels Oct 28, 2016
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 26, 2017
@arielb1
Copy link
Contributor

arielb1 commented Dec 20, 2017

This is an LLVM assertion:

rustc: /home/ariel/Rust/rust-master/src/llvm/lib/IR/InlineAsm.cpp:46: llvm::InlineAsm::InlineAsm(llvm::FunctionType*, const string&, const string&, bool, bool, llvm::InlineAsm::AsmDialect): Assertion `Verify(getFunctionType(), constraints) && "Function type not legal for constraints!"' failed.
Aborted

@levex
Copy link
Contributor

levex commented Sep 30, 2018

@Centril Centril added the requires-nightly This issue requires a nightly compiler in some way. label Oct 25, 2019
@Amanieu
Copy link
Member

Amanieu commented May 22, 2020

This issue does not apply to the new asm! (RFC 2850) which has stricter checks on the types that can be used as asm operands.

The legacy llvm_asm! is deprecated and is no longer maintained.

@Amanieu Amanieu closed this as completed May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. requires-nightly This issue requires a nightly compiler in some way.
Projects
None yet
Development

No branches or pull requests

7 participants