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

ICE: static call to invalid vtable: VtableFnPointer #20847

Closed
ghost opened this issue Jan 10, 2015 · 8 comments
Closed

ICE: static call to invalid vtable: VtableFnPointer #20847

ghost opened this issue Jan 10, 2015 · 8 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ghost
Copy link

ghost commented Jan 10, 2015

#![feature(unboxed_closures)]
use std::ops::Fn;
fn say(x: u32, y: u32) {
    println!("{} {}", x, y);
}
fn main() {
    Fn::call(&say, (1, 2));
}
rustc 1.0.0-nightly (44a287e6e 2015-01-08 17:03:40 -0800)
binary: rustc
commit-hash: 44a287e6eb22ec3c2a687fc156813577464017f7
commit-date: 2015-01-08 17:03:40 -0800
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly
$ RUST_BACKTRACE=1 rustc main.rs
main.rs:7:5: 7:13 warning: use of unstable item: uncertain about variadic generics, input versus associated types, #[warn(unstable)] on by default
main.rs:7     Fn::call(&say, (1, 2));
              ^~~~~~~~
error: internal compiler error: static call to invalid vtable: VtableFnPointer(fn(u32, u32) {say})
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:182

stack backtrace:
   1:     0x7f28a8488850 - sys::backtrace::write::h5b05e7b061a35107Czt
   2:     0x7f28a84aaa60 - failure::on_fail::h1e9b7e3de59488d1aPz
   3:     0x7f28a84185e0 - rt::unwind::begin_unwind_inner::h23dcfb4c37870bd62tz
   4:     0x7f28a3230460 - rt::unwind::begin_unwind::h8180555736548804672
   5:     0x7f28a3230d10 - diagnostic::Handler::bug::hfea99a1512d774b6tWF
   6:     0x7f28a67880d0 - session::Session::bug::hda4aef05452f83daiRq
   7:     0x7f28a748d1f0 - trans::meth::trans_static_method_callee::h7b45cabbb9a118b8sbz
   8:     0x7f28a748a0d0 - trans::callee::trans::h36851c362b65c790yag
   9:     0x7f28a74942f0 - trans::callee::trans_call_inner::h8685402877239769531
  10:     0x7f28a7499d10 - trans::expr::trans_rvalue_dps_unadjusted::hadddfbae4195cb641Si
  11:     0x7f28a74505f0 - trans::expr::trans_into::ha60adcbe08fa3bdbKyh
  12:     0x7f28a744f9b0 - trans::controlflow::trans_stmt_semi::hce06ed398066bc74K2d
  13:     0x7f28a7450c40 - trans::controlflow::trans_block::hdd6a1a94b7524b90B3d
  14:     0x7f28a751cc70 - trans::base::trans_closure::h1947fd5123bfe895EYt
  15:     0x7f28a743bb10 - trans::base::trans_fn::h5d061f11fc4ac1e7j9t
  16:     0x7f28a74370a0 - trans::base::trans_item::h34ec82732f0498f3Ewu
  17:     0x7f28a7524490 - trans::base::trans_crate::he5ffa45aaa619f67lsv
  18:     0x7f28a89e63c0 - driver::phase_4_translate_to_llvm::h98aea3c7bb04643bPFa
  19:     0x7f28a89c0350 - driver::compile_input::h04aea004c559b910xba
  20:     0x7f28a8a8ffe0 - monitor::unboxed_closure.22497
  21:     0x7f28a8a8fe40 - thunk::F.Invoke<A, R>::invoke::h11849311349984608396
  22:     0x7f28a8a8ebc0 - rt::unwind::try::try_fn::h13617610205470131813
  23:     0x7f28a85106c0 - rust_try_inner
  24:     0x7f28a85106b0 - rust_try
  25:     0x7f28a8a8eeb0 - thunk::F.Invoke<A, R>::invoke::h14452289732390470265
  26:     0x7f28a8498910 - sys::thread::thread_start::h93b0d38960a9fcacqrw
  27:     0x7f28a2a4e250 - start_thread
  28:     0x7f28a80ce219 - clone
  29:                0x0 - <unknown>
@shepmaster
Copy link
Member

Duplicate of #20676?

@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 10, 2015
@shepmaster
Copy link
Member

After updating my local copy with #21089, this still occurs. I no longer think it is a duplicate. /cc @nikomatsakis

@nikomatsakis
Copy link
Contributor

Nope, not a duplicate, but a very similar oversight on my part!

@ghost ghost added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 3, 2015
@jooert
Copy link
Contributor

jooert commented May 5, 2015

Slightly updated example

#![feature(core, unboxed_closures)]
use std::ops::Fn;
fn say(x: u32, y: u32) {
    println!("{} {}", x, y);
}
fn main() {
    Fn::call(&say, (1, 2));
}

still triggers the ICE on rustc 1.1.0-dev (9b481f89d 2015-05-04).

@frewsxcv
Copy link
Member

Still causing an ICE on rust nightly

Playpen: http://is.gd/rZbpQe

@apasel422
Copy link
Contributor

This still causes an ICE on nightly with the code in @jooert's comment.

bltavares pushed a commit to bltavares/glacier that referenced this issue Oct 25, 2015
@arielb1 arielb1 removed the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jan 21, 2016
@ghost
Copy link
Author

ghost commented Aug 6, 2016

This appears to be fixed:

// main.rs
#![feature(fn_traits)]
use std::ops::Fn;
fn say(x: u32, y: u32) {
    println!("{} {}", x, y);
}
fn main() {
    Fn::call(&say, (1, 2));
}
$ rustup run nightly rustc --version
rustc 1.12.0-nightly (545a3a94f 2016-08-04)
$ rustup run nightly rustc main.rs
$ ./main
1 2

@ghost ghost closed this as completed Aug 6, 2016
frewsxcv added a commit to frewsxcv/rust that referenced this issue Aug 6, 2016
@frewsxcv
Copy link
Member

frewsxcv commented Aug 6, 2016

Added a regression test in #35432

bors added a commit that referenced this issue Aug 7, 2016
This issue was closed.
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

7 participants