Skip to content

Rust panic at assertion in latest nightly #20734

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
obsgolem opened this issue Jan 8, 2015 · 3 comments
Closed

Rust panic at assertion in latest nightly #20734

obsgolem opened this issue Jan 8, 2015 · 3 comments
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@obsgolem
Copy link
Contributor

obsgolem commented Jan 8, 2015

I am consistently getting a panic when compiling a particular project. It does not appear to occur when compiling one of libraries that project depends on: https://github.com/retep998/winapi-rs. The project being compiled is a library. The panic appears to chronologically occur after the compiler generates dead code warnings. Here is my backtrace:

Compiling win32_experiment v0.0.1 (file:///PATH_HERE)
thread 'rustc' panicked at 'assertion failed: f.abi == Rust || f.abi == RustCall', C:\bot\slave\nightly-dist-rustc-win-64\build\src\librustc_trans\trans\base.rs:2418

stack backtrace:
   1:         0x69bee9cd - sys::backtrace::write::hd40c6de25ef01e0bfjt
   2:         0x69c01a32 - rt::unwind::register::hcb202fda23aef97aw7y
   3:         0x69b834a7 - rt::unwind::begin_unwind_inner::h43ca250f1ae88b3e64y
   4:          0x1423d4c - trans::context::CrateContext<'b, 'tcx>::link_meta::ha7fe491c1a9e61d23qm
   5:          0x1540ee7 - trans::cleanup::FunctionContext<'blk, 'tcx>.CleanupMethods<'blk, 'tcx>::push_custom_cleanup_scope_with_debug_loc::hc8a6918f1c87a4b9ngK
   6:          0x1542dce - trans::cleanup::FunctionContext<'blk, 'tcx>.CleanupMethods<'blk, 'tcx>::push_custom_cleanup_scope_with_debug_loc::hc8a6918f1c87a4b9ngK
   7:          0x145dcad - trans::context::CrateContext<'b, 'tcx>::sess::h0c92734bae2bfb65wmm
   8:          0x145c390 - trans::context::CrateContext<'b, 'tcx>::stats::hfdf50b198e5f7592qzm
   9:          0x153fc48 - trans::cleanup::FunctionContext<'blk, 'tcx>.CleanupMethods<'blk, 'tcx>::push_custom_cleanup_scope_with_debug_loc::hc8a6918f1c87a4b9ngK
  10:          0x145b857 - trans::context::CrateContext<'b, 'tcx>::stats::hfdf50b198e5f7592qzm
  11:          0x1544728 - trans::base::trans_crate::ha9ad2d2ee040c191Udv
  12:         0x70b2543a - driver::phase_4_translate_to_llvm::h9dcbc7c0b9c8c65bJFa
  13:         0x70b03243 - driver::compile_input::h45b30318e07c4cf6vba
  14:         0x70bcaa1e - run::heefafb1ff7869308B4b
  15:         0x70bc786a - run::heefafb1ff7869308B4b
  16:         0x69c288fc - rust_try
  17:         0x69c288d9 - rust_try
  18:         0x70bc7fa9 - run::heefafb1ff7869308B4b
  19:         0x69bf3457 - sys::tcp::TcpListener::bind::hfcf283b88d14d24bfTv
  20:     0x7ffd5c43a6e2 - BaseThreadInitThunk

This is the output of rustc --version --verbose

rustc 1.0.0-nightly (ea6f65c5f 2015-01-06 19:47:08 +0000)
binary: rustc
commit-hash: ea6f65c5f1a3f84e010d2cef02a0160804e9567a
commit-date: 2015-01-06 19:47:08 +0000
host: x86_64-pc-windows-gnu
release: 1.0.0-nightly
@nrc nrc added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-codegen Area: Code generation labels Jan 8, 2015
@obsgolem
Copy link
Contributor Author

obsgolem commented Jan 9, 2015

Still occurring in rustc 1.0.0-nightly (44a287e6e 2015-01-08 17:03:40 -0800).

@obsgolem
Copy link
Contributor Author

obsgolem commented Jan 9, 2015

I have found the cause of the panic. If you try to define an extern "system" function in the impl of a struct the compiler panics. This is the code used to reproduce the bug:

struct A;
impl A {
    extern "system" fn a() {
        println!("this does not compile");
    }
}

fn main() {
    println!("doesn't work in binaries");
}

This is the backtrace on the latest nightly 44a287e:

thread 'rustc' panicked at 'assertion failed: f.abi == Rust || f.abi == RustCall', C:\bot\slave\nightly-dist-rustc-win-64\build\src\librustc_trans\trans\base.rs:2438

stack backtrace:
   1:         0x69bec997 - sys::backtrace::write::h62d87c63e18a3ea5JRt
   2:         0x69c00672 - rt::unwind::register::haa3a38fa07bfa9beVGz
   3:         0x69b834a7 - rt::unwind::begin_unwind_inner::hbebf9f8c0125ffc9tEz
   4:          0x1473bac - trans::context::CrateContext<'b, 'tcx>::link_meta::h9c4774348aced35ahym
   5:          0x158fe67 - trans::cleanup::FunctionContext<'blk, 'tcx>.CleanupMethods<'blk, 'tcx>::push_custom_cleanup_scope_with_debug_loc::h2dd10ee030f9c94e6DK
   6:          0x1591bce - trans::cleanup::FunctionContext<'blk, 'tcx>.CleanupMethods<'blk, 'tcx>::push_custom_cleanup_scope_with_debug_loc::h2dd10ee030f9c94e6DK
   7:          0x14ac310 - trans::context::CrateContext<'b, 'tcx>::sess::h6fdd1e7dea5490cdItm
   8:          0x14aa9a2 - trans::context::CrateContext<'b, 'tcx>::stats::hd7a1dc7a2465d605EGm
   9:          0x1593768 - trans::base::trans_crate::h4bc502f506e6c118Wsv
  10:         0x70b2af6a - driver::phase_4_translate_to_llvm::haa9c5e826483e242PFa
  11:         0x70b03623 - driver::compile_input::hf5b2f58693da03b5xba
  12:         0x70bd1eec - run::ha65e56249318cc0dV3b
  13:         0x70bd04cc - run::ha65e56249318cc0dV3b
  14:         0x70bcf16a - run::ha65e56249318cc0dV3b
  15:         0x69c2881c - rust_try
  16:         0x69c287f9 - rust_try
  17:         0x70bcf854 - run::ha65e56249318cc0dV3b
  18:         0x69bf14a7 - sys::tcp::TcpListener::bind::hc4a8da4adad0f541bsw
  19:     0x7ffd5c43a6e2 - BaseThreadInitThunk

@Gankra
Copy link
Contributor

Gankra commented Jan 21, 2015

Still occuring.

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

No branches or pull requests

3 participants