Skip to content

Typechecker ICE with constant names in patterns and match on literal #5353

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

Closed
jeaye opened this issue Mar 13, 2013 · 6 comments
Closed

Typechecker ICE with constant names in patterns and match on literal #5353

jeaye opened this issue Mar 13, 2013 · 6 comments
Labels
A-type-system Area: Type system I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Milestone

Comments

@jeaye
Copy link

jeaye commented Mar 13, 2013

Trace:

rust: task failed at 'option::get none', /home/jeaye/projects/rust_work/rust/src/libcore/option.rs:107
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_j+0x5a)[0xb4c732ba]
/usr/local/bin/../lib/librustrt.so(rust_task_fail+0x36)[0xb4c733b6]
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task4failEPKcS1_j+0x32)[0xb4c73422]
/usr/local/bin/../lib/librustrt.so(upcall_s_fail+0x53)[0xb4c74c03]
/usr/local/bin/../lib/librustrt.so(+0x2914f)[0xb4c8514f]
/usr/local/bin/../lib/librustrt.so(upcall_fail+0x174)[0xb4c75244]
/usr/local/bin/../lib/librustrt.so(rust_upcall_fail+0x2b)[0xb4c7538b]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(_ZN3sys6rustrt16rust_upcall_fail17_2b2e25ba94c412183_06E+0x45)[0xb75d7945]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0xee9eb)[0xb75d79eb]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0xee99d)[0xb75d799d]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(_ZN3sys12begin_unwind17_7cd364c41f10422f3_06E+0x73)[0xb751fca3]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6middle11check_match11pat_ctor_id16_2d1b278bef21d493_06E+0xa54)[0xb68deaa4]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6middle11check_match9is_useful17_1fac2c1010595d6e3_06E+0x1dc)[0xb68db79c]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8cd088)[0xb6bc5088]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x5e330c)[0xb68db30c]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6middle11check_match10check_arms16_3ae84f572dfd6663_06E+0xd6)[0xb68d94d6]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6middle11check_match10check_expr15_db04d138a15d633_06E+0x155)[0xb68d7cb5]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x5df970)[0xb68d7970]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x3d7a70)[0xb66cfa70]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x3d795b)[0xb66cf95b]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x3da568)[0xb66d2568]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6middle11check_match8check_fn17_a9ead7a0dab8511d3_06E+0x4f)[0xb68d8eff]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x5e0e9e)[0xb68d8e9e]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x3d6aa9)[0xb66ceaa9]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x3d68db)[0xb66ce8db]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x3d6610)[0xb66ce610]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6middle11check_match11check_crate16_6c3580155784d873_06E+0x340)[0xb68d7320]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x88e139)[0xb6b86139]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x88d4d9)[0xb6b854d9]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6driver6driver12compile_rest16_3ae09542b2d302c3_06E+0x20d9)[0xb6b81739]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8cd088)[0xb6bc5088]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6driver6driver12compile_upto17_633c8cc6f3f7f6e93_06E+0x103)[0xb6b86593]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN6driver6driver13compile_input17_9baf8b2d9e1187833_06E+0xb6)[0xb6b86a96]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN12run_compiler17_2c50e7a55977d4c63_06E+0x2444)[0xb6bb3754]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8cce02)[0xb6bc4e02]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8ca469)[0xb6bc2469]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8c6095)[0xb6bbe095]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8cd088)[0xb6bc5088]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0xb644f)[0xb759f44f]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0x12672c)[0xb760f72c]
/usr/local/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x31)[0xb4c73c01]
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=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /home/jeaye/projects/rust_work/rust/src/librustc/rustc.rc:359
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task13begin_failureEPKcS1_j+0x5a)[0xb4c732ba]
/usr/local/bin/../lib/librustrt.so(rust_task_fail+0x36)[0xb4c733b6]
/usr/local/bin/../lib/librustrt.so(_ZN9rust_task4failEPKcS1_j+0x32)[0xb4c73422]
/usr/local/bin/../lib/librustrt.so(upcall_s_fail+0x53)[0xb4c74c03]
/usr/local/bin/../lib/librustrt.so(+0x2914f)[0xb4c8514f]
/usr/local/bin/../lib/librustrt.so(upcall_fail+0x174)[0xb4c75244]
/usr/local/bin/../lib/librustrt.so(rust_upcall_fail+0x2b)[0xb4c7538b]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(_ZN3sys6rustrt16rust_upcall_fail17_2b2e25ba94c412183_06E+0x45)[0xb75d7945]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0xee9eb)[0xb75d79eb]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0xee99d)[0xb75d799d]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(_ZN3sys12begin_unwind17_7cd364c41f10422f3_06E+0x73)[0xb751fca3]
/usr/local/bin/../lib/libcore-c3ca5d77d81b46c1-0.6.so(+0x12672c)[0xb760f72c]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN7monitor16_9db0d8295229e643_06E+0x221d)[0xb6bb6add]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(+0x8cd088)[0xb6bc5088]
/usr/local/bin/../lib/librustc-c84825241471686d-0.6.so(_ZN4main16_706f4ee7413ae583_06E+0x7e)[0xb6bc4d1e]
rustc(_rust_main+0x31)[0x80489c1]
/usr/local/bin/../lib/librustrt.so(_Z18task_start_wrapperP10spawn_args+0x31)[0xb4c73c01]
rust: domain main @0x98cf380 root task failed

Source: (troubled function: gl_err_str)

extern mod glfw;
extern mod opengles;
extern mod std;

use opengles::*;
use opengles::gl2::{ INVALID_ENUM, INVALID_VALUE, INVALID_OPERATION, INVALID_FRAMEBUFFER_OPERATION, OUT_OF_MEMORY, STACK_UNDERFLOW, STACK_OVERFLOW };

fn gl_err_str(err: u32) -> ~str
{
  match err
  {
    INVALID_ENUM => { ~"Invalid enum" },
    INVALID_VALUE => { ~"Invalid value" },
    INVALID_OPERATION => { ~"Invalid operation" },
    INVALID_FRAMEBUFFER_OPERATION => { ~"Invalid frame buffer operation" },
    OUT_OF_MEMORY => { ~"Out of memory" },
    STACK_UNDERFLOW => { ~"Stack underflow" },
    STACK_OVERFLOW => { ~"Stack overflow" },
    _ => { ~"Unknown error" }
  }
}

macro_rules! check
(
  ($func:expr) => 
  ({
    let ret = $func;

    let err = gl2::get_error();
    if err != gl2::NO_ERROR
    { io::println(fmt!("GL error: %s", gl_err_str(err))); }

    ret
  });
)

fn main() {
  glfw::set_error_callback(error_callback);

  do glfw::spawn {
    let window = glfw::Window::create(300, 300, "Rusty", glfw::Windowed).unwrap();

    window.set_key_callback(key_callback);
    window.make_context_current();

    check!(gl2::clear_color(1.0, 0.0, 0.0, 1.0));

    while !window.should_close() {
      glfw::poll_events();

      check!(gl2::clear(gl2::COLOR_BUFFER_BIT));
      check!(gl2::clear(-1));
      {

      } window.swap_buffers();

      std::timer::sleep(@std::uv::global_loop::get(), 16);
    }
  }
}

fn key_callback(window: &glfw::Window, key: libc::c_int, action: libc::c_int) {
  if action == glfw::PRESS && key == glfw::KEY_ESCAPE {
    window.set_should_close(true);
  }
}

fn error_callback(_error: libc::c_int, description: ~str) {
  io::println(fmt!("GLFW Error: %s", description));
}
@catamorphism
Copy link
Contributor

Changed title to reflect what the crash is.

@ghost ghost assigned catamorphism Apr 25, 2013
@catamorphism
Copy link
Contributor

I think this is fixed now, though I can't be completely sure as I don't have the libraries installed (I made up some constant definitions so I could compile just gl_err_str).

I'll check in a test case. If you can still reproduce the crash with a self-contained test case, please comment. Thanks!

@catamorphism
Copy link
Contributor

Test case pending #6368 -- once that lands, this can be closed.

@jeaye
Copy link
Author

jeaye commented May 9, 2013

This is in incoming now? If so, I'll give it a shot tonight.

@catamorphism
Copy link
Contributor

@jeaye - I tested with 7a4c6e5, yes.

@catamorphism
Copy link
Contributor

Checked in test case in 842e304 .

bors added a commit to rust-lang-ci/rust that referenced this issue May 2, 2020
Fix documentation generation for configurable lints

In rust-lang#5135, the configuration macro changed, but the documentation generation script wasn't updated. This PR catches up on this.

[Preview](https://flip1995.github.io/rust-clippy/master/index.html)

r? @Manishearth

changelog: Document configuration options of lints again.
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