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

error: internal compiler error: unexpected failure #3044

Closed
varnie opened this issue Jul 27, 2012 · 1 comment
Closed

error: internal compiler error: unexpected failure #3044

varnie opened this issue Jul 27, 2012 · 1 comment
Labels
A-typesystem Area: The type system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Milestone

Comments

@varnie
Copy link

varnie commented Jul 27, 2012

Hi there. The following small test case demonstrates the bug (I misused vec::foldr function):

fn main() {
    let needlesArr: ~[char] = ~['a', 'f'];
    do vec::foldr(needlesArr) |x, y| {
        //empty
    }
}

The bug message and stacktrace (I rerun it with "RUST_LOG=rustc=0,::rt::backtrace" as it suggested) is below.
The scary "error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug" gripped my attention.

> rustc ~/thrash/bug.rs
/home/varnie/thrash/bug.rs:3:7: 3:31 error: this function takes 3 parameters but 2 parameters were supplied
/home/varnie/thrash/bug.rs:3     do vec::foldr(needlesArr) |x, y| {
                                    ^~~~~~~~~~~~~~~~~~~~~~~~
rust: task failed at 'option none', /home/varnie/thrash/rust/src/rustc/rustc.rc:1
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_j+0x72)[0xb5eb43c2]
/usr/local/bin/../lib/librustrt.so(rust_task_fail+0x36)[0xb5eb4466]
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task4failEPKcS1_j+0x32)[0xb5eb44d2]
/usr/local/bin/../lib/librustrt.so(upcall_s_fail+0x53)[0xb5eb6e93]
/usr/local/bin/../lib/librustrt.so(+0x2e693)[0xb5eca693]
/usr/local/bin/../lib/librustrt.so(upcall_fail+0x1be)[0xb5eb817e]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(+0x392536)[0xb6287536]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(+0x39eaa7)[0xb6293aa7]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(+0x39e24a)[0xb629324a]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(+0x5ebc8c)[0xb64e0c8c]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(+0x390063)[0xb6285063]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(+0x5ebc8c)[0xb64e0c8c]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(+0x329537)[0xb621e537]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(+0x3603ba)[0xb62553ba]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(+0x35ed53)[0xb6253d53]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(+0x35cca7)[0xb6251ca7]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(+0x5ebc8c)[0xb64e0c8c]
/usr/local/bin/../lib/libsyntax-b45cc7d0b085bc34-0.3.so(+0x9e687)[0xb6899687]
/usr/local/bin/../lib/libsyntax-b45cc7d0b085bc34-0.3.so(+0x9e4e0)[0xb68994e0]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(_ZN6middle6typeck11check_crate17_2914875f16fe66be3_03E+0x1143)[0xb62f9a23]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(_ZN6driver6driver12compile_upto17_72edd05480e097483_03E+0x1124)[0xb64b7d24]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(+0x5ebc8c)[0xb64e0c8c]
/usr/local/bin/../lib/librustc-73389320c1332876-0.3.so(_ZN6driver6driver13compile_input17_dc2f7342b6a0a3fe3_03E+0xc5)[0xb64bb6b5]
rustc[0x804e5af]
rustc[0x8058f64]
rustc[0x8058c32]
rustc[0x805507b]
rustc[0x805447d]
/usr/local/bin/../lib/libcore-d27e4777a53c3e50-0.3.so(+0x4ccac)[0xb7384cac]
/usr/local/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x31)[0xb5eb5581]
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/varnie/thrash/rust/src/rustc/driver/rustc.rs:256
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_j+0x72)[0xb5eb43c2]
/usr/local/bin/../lib/librustrt.so(rust_task_fail+0x36)[0xb5eb4466]
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task4failEPKcS1_j+0x32)[0xb5eb44d2]
/usr/local/bin/../lib/librustrt.so(upcall_s_fail+0x53)[0xb5eb6e93]
/usr/local/bin/../lib/librustrt.so(+0x2e693)[0xb5eca693]
/usr/local/bin/../lib/librustrt.so(upcall_fail+0x1be)[0xb5eb817e]
rustc[0x805384d]
rustc[0x8058f64]
rustc[0x8058b3b]
rustc(_rust_main+0x38)[0x8058b88]
/usr/local/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x31)[0xb5eb5581]
rust: domain main @0x901c0b8 root task failed
rust: task failed at 'killed', /home/varnie/thrash/rust/src/libcore/task.rs:523
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_j+0x72)[0xb5eb43c2]
/usr/local/bin/../lib/librustrt.so(rust_task_fail+0x36)[0xb5eb4466]
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task4failEPKcS1_j+0x32)[0xb5eb44d2]
/usr/local/bin/../lib/librustrt.so(upcall_s_fail+0x53)[0xb5eb6e93]
/usr/local/bin/../lib/librustrt.so(+0x2e693)[0xb5eca693]
/usr/local/bin/../lib/librustrt.so(upcall_fail+0x1be)[0xb5eb817e]
/usr/local/bin/../lib/libcore-d27e4777a53c3e50-0.3.so(_ZN4task5yield17_8bfde8cf2fff81633_03E+0xc2)[0xb7372f12]
/usr/local/bin/../lib/libcore-d27e4777a53c3e50-0.3.so(+0x626e5)[0xb739a6e5]
/usr/local/bin/../lib/libcore-d27e4777a53c3e50-0.3.so(_ZN4priv11weaken_task17_2b14e75713b55a573_03E+0xed)[0xb739a57d]
/usr/local/bin/../lib/libcore-d27e4777a53c3e50-0.3.so(+0x62404)[0xb739a404]
/usr/local/bin/../lib/libcore-d27e4777a53c3e50-0.3.so(+0x7d5f8)[0xb73b55f8]
/usr/local/bin/../lib/libcore-d27e4777a53c3e50-0.3.so(+0x614a6)[0xb73994a6]
/usr/local/bin/../lib/libcore-d27e4777a53c3e50-0.3.so(+0x6069d)[0xb739869d]
/usr/local/bin/../lib/libcore-d27e4777a53c3e50-0.3.so(+0x4ccac)[0xb7384cac]
/usr/local/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x31)[0xb5eb5581]

My rustc version and system info:

varnie@heimdal:~/thrash/rust/src/rustc/middle/typeck/check$ rustc -v
rustc 0.3 (6081eb7 2012-07-15 05:41:24 -0700)
host: i686-unknown-linux-gnu

Hope it helps

@nikomatsakis
Copy link
Contributor

my guess is that we are using span_err and not span_fatal (good) but not setting up the results correctly for the latter code that runs (bad). maybe even my fault since I remember mucking about trying to make more use of span_err

bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
Fix bug in import where two consecutive module separators were possible.
RalfJung pushed a commit to RalfJung/rust that referenced this issue Aug 31, 2023
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Upgrades the Rust toolchain to `nightly-2024-02-25`. The Rust compiler
PRs that triggered changes in this upgrades are:
 * rust-lang#121209
 * rust-lang#121309
 * rust-lang#120863
 * rust-lang#117772
 * rust-lang#117658

With rust-lang#121309 some intrinsics
became inlineable so their names became qualified. This made our `match`
on the intrinsic name to fail in those cases, leaving them as
unsupported constructs as in this example:

```
warning: Found the following unsupported constructs:
             - _RNvNtCscyGW2MM2t5j_4core10intrinsics8unlikelyCs1eohKeNmpdS_5arith (3)
             - caller_location (1)
             - foreign function (1)
         
         Verification will fail if one or more of these constructs is reachable.
         See https://model-checking.github.io/kani/rust-feature-support.html for more details.

[...]

Failed Checks: _RNvNtCscyGW2MM2t5j_4core10intrinsics8unlikelyCs1eohKeNmpdS_5arith is not currently supported by Kani. Please post your example at https://github.com/model-checking/kani/issues/new/choose
 File: "/home/ubuntu/.rustup/toolchains/nightly-2024-02-18-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/mod.rs", line 25, in core::num::<impl i8>::checked_add
```

We use `trimmed_name()` to work around this, but that may include type
arguments if the intrinsic is defined on generics. So in those cases, we
just take the first part of the name so we can keep the rest as before.

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

No branches or pull requests

3 participants