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

internal compiler error trying to match None against Err(_) #3680

Closed
ben0x539 opened this issue Oct 6, 2012 · 2 comments
Closed

internal compiler error trying to match None against Err(_) #3680

ben0x539 opened this issue Oct 6, 2012 · 2 comments
Labels
A-type-system Area: Type system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Milestone

Comments

@ben0x539
Copy link
Contributor

ben0x539 commented Oct 6, 2012

This is a reduced, invalid code snippet that produces an internal compiler error after diagnosing a type error:

fn f() {
    match None {
            Err(_) => ()
    }
}

Here is the stack traces produced by the RUST_LOG settings suggested by the original error message:

$ RUST_LOG=rustc=0,::rt::backtrace rustc foo.rs
foo.rs:3:12: 3:21 error: mismatched types: expected `core::result::Result<<V2>,<V3>>` but found `core::option::Option<<V1>>` (expected enum core::result::Result but found enum core::option::Option)
foo.rs:3             Err(_) => ()
                     ^~~~~~~~~
rust: task failed at 'index out of bounds: the len is 1 but the index is 1', /home/ben/code/repos/rust/src/rustc/middle/ty.rs:1451
/home/ben/local/lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x5d)[0x7f89a8502e9d]
/home/ben/local/lib/librustrt.so(+0x3377d)[0x7f89a851a77d]
/home/ben/local/lib/librustrt.so(upcall_fail+0x1a8)[0x7f89a8505788]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(_ZN2rt20rt_fail_bounds_check17_e739cc78d15657703_04E+0x1a0)[0x7f89a9b46cd0]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x29f504)[0x7f89a89ea504]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(_ZN6middle2ty5subst17_7a3ff3a9684ad3303_04E+0x2fb)[0x7f89a88e5dbb]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x100521)[0x7f89a884b521]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x3341dd)[0x7f89a8a7f1dd]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x32a8cf)[0x7f89a8a758cf]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x325182)[0x7f89a8a70182]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x3bc990)[0x7f89a8b07990]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x69bcc0)[0x7f89a8de6cc0]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x3326b8)[0x7f89a8a7d6b8]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x69bcc0)[0x7f89a8de6cc0]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x385240)[0x7f89a8ad0240]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x383943)[0x7f89a8ace943]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x38119a)[0x7f89a8acc19a]
/home/ben/local/lib/libsyntax-84efebcb12c867a2-0.4.so(+0xb11cd)[0x7f89a92791cd]
/home/ben/local/lib/libsyntax-84efebcb12c867a2-0.4.so(+0xb1034)[0x7f89a9279034]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(_ZN6middle6typeck11check_crate17_bbe1149ff42c4fc93_04E+0xd49)[0x7f89a8bae5b9]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(_ZN6driver6driver12compile_upto17_25761dc338c52ad63_04E+0x1646)[0x7f89a8dbbeb6]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(+0x69bcc0)[0x7f89a8de6cc0]
/home/ben/local/lib/librustc-c84825241471686d-0.4.so(_ZN6driver6driver13compile_input17_3df932b1ac436bdb3_04E+0xbd)[0x7f89a8dbf1bd]
rustc[0x4091d6]
rustc[0x412534]
rustc[0x40e9b3]
rustc[0x40d66c]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x7985f)[0x7f89a9b7b85f]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(+0xb9540)[0x7f89a9bbb540]
/home/ben/local/lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x24)[0x7f89a8503644]
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /home/ben/code/repos/rust/src/rustc/driver/rustc.rs:275
/home/ben/local/lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x5d)[0x7f89a8502e9d]
/home/ben/local/lib/librustrt.so(+0x3377d)[0x7f89a851a77d]
/home/ben/local/lib/librustrt.so(upcall_fail+0x1a8)[0x7f89a8505788]
rustc(_rust_main+0x838)[0x411d48]
rustc[0x412534]
/home/ben/local/lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x24)[0x7f89a8503644]
rust: domain main @0x1779200 root task failed
rust: task failed at 'killed', /home/ben/code/repos/rust/src/libcore/task.rs:663
/home/ben/local/lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_m+0x5d)[0x7f89a8502e9d]
/home/ben/local/lib/librustrt.so(+0x3377d)[0x7f89a851a77d]
/home/ben/local/lib/librustrt.so(upcall_fail+0x1a8)[0x7f89a8505788]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(_ZN4task5yield16_9531951b4f79f8b3_04E+0xbd)[0x7f89a9b64e1d]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x946e6)[0x7f89a9b966e6]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(_ZN7private11weaken_task17_16b955f1119438ce3_04E+0xd2)[0x7f89a9b96522]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x9441b)[0x7f89a9b9641b]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(+0xb9540)[0x7f89a9bbb540]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x93770)[0x7f89a9b95770]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x9310e)[0x7f89a9b9510e]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x92776)[0x7f89a9b94776]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(+0x7985f)[0x7f89a9b7b85f]
/home/ben/local/lib/libcore-c3ca5d77d81b46c1-0.4.so(+0xb9540)[0x7f89a9bbb540]
/home/ben/local/lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x24)[0x7f89a8503644]

This is with rustc built on incoming at commit f96a2a2.

@catamorphism
Copy link
Contributor

Reproduced as of d2ad028 -- looks like the error isn't fatal enough.

@ghost ghost assigned catamorphism Dec 11, 2012
@catamorphism
Copy link
Contributor

I have a fix -- just running tests now.

RalfJung pushed a commit to RalfJung/rust that referenced this issue Jun 29, 2024
Fix ICE caused by seeking past `i64::MAX`

Make Miri behave the same as standard library on file seeking offset.

Fixes rust-lang#3680.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants