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 crash for unreachable io loop #5741

Closed
ramonsnir opened this issue Apr 5, 2013 · 2 comments
Closed

rustc crash for unreachable io loop #5741

ramonsnir opened this issue Apr 5, 2013 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ramonsnir
Copy link

The following sample crashed rustc:

fn main() {
    return;
    while io::stdin().read_line() != ~"quit" { };
}

Removing the return;, or unwrapping the while (leaving only io::stdin().read_line() != ~"quit";), or replacing the predicate (leaving while 2 != 3 { };), solves the crash.

Reproduced on Windows 64-bit, Fedora 32-bit, Ubuntu 64-bit.

Full crash log (thanks to dbaupp) @ https://gist.github.com/dbaupp/5318920
Short crash message:

rustc: /home/huon/rust/src/llvm/include/llvm/Support/Casting.h:197:
typename llvm::cast_retty<To, From>::ret_type llvm::cast(const Y&)
[with X = llvm::SequentialType; Y = llvm::Type*;
typename llvm::cast_retty<To, From>::ret_type = llvm::SequentialType*]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
catamorphism added a commit to catamorphism/rust that referenced this issue May 21, 2013
The way we deal with unreachable expressions in trans is pretty ad hoc,
but this at least doesn't make it worse, and eliminates the LLVM
assertion failure reported in rust-lang#5741.
@catamorphism
Copy link
Contributor

Fixed pending #6665

@ghost ghost assigned catamorphism May 21, 2013
bors added a commit that referenced this issue May 21, 2013
r? @nikomatsakis The way we deal with unreachable expressions in trans is pretty ad hoc,
but this at least doesn't make it worse, and eliminates the LLVM
assertion failure reported in #5741.
@catamorphism
Copy link
Contributor

Fixed in 15e4438

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 23, 2020
Rollup of 9 pull requests

Successful merges:

 - rust-lang#5178 (clippy-driver: pass all args to rustc if --rustc is present)
 - rust-lang#5705 (Downgrade unnested_or_patterns to pedantic)
 - rust-lang#5709 (Fix ICE in consts::binop)
 - rust-lang#5710 (typo)
 - rust-lang#5712 (Remove `bar` from blacklisted names)
 - rust-lang#5713 (Use lints in Clippy that are enabled in rustc bootstrap)
 - rust-lang#5716 (Fix typo in wildcard_imports)
 - rust-lang#5724 (redundant_pattern_matching: avoid non-`const fn` calls in const contexts)
 - rust-lang#5726 (Fix typo)

Failed merges:

r? @ghost

changelog: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants