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: unimplemented foreign functions with Rust ABI #23278

Closed
mark3982 opened this issue Mar 11, 2015 · 5 comments
Closed

ICE: unimplemented foreign functions with Rust ABI #23278

mark3982 opened this issue Mar 11, 2015 · 5 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@mark3982
Copy link

error: internal compiler error: unimplemented foreign functions with Rust ABI
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /mnt/host/kmcg3413.net/rust/src/libsyntax/diagnostic.rs:189

stack backtrace:
   1:     0x7f614b4d6772 - sys::backtrace::write::hf2cbe7ef4486b86aIDA
   2:     0x7f614b4fc7f2 - panicking::on_panic::he84feb8369199f6ebJJ
   3:     0x7f614b442e59 - rt::unwind::begin_unwind_inner::h23c9613fd5cda727epJ
   4:     0x7f6148a7acbd - rt::unwind::begin_unwind::h15201399472590650528
   5:     0x7f6148a7b4f5 - diagnostic::Handler::bug::he54a8ae8f22ddcc8GdE
   6:     0x7f6148a7b5c4 - diagnostic::Handler::unimpl::ha56677ddd99e28b6leE
   7:     0x7f61497003bb - session::Session::unimpl::h68e50f0bb54be78frZp
   8:     0x7f614acaddcb - trans::foreign::llvm_calling_convention::h44561cf6ae228910QNA
   9:     0x7f614ac6052b - trans::foreign::register_foreign_item_fn::h16acdaac87c5cffaARA
  10:     0x7f614ab9d69c - trans::base::get_item_val::h954ded8ff9256432ctu
  11:     0x7f614abd67f7 - trans::callee::trans_fn_ref_with_substs::hb375d83ac616a594ong
  12:     0x7f614abd52a9 - trans::callee::trans_fn_ref::hbd5a38063ce6f684Ybg
  13:     0x7f614abd32b2 - trans::callee::trans::h391e2ad0af4ecbdcf1f
  14:     0x7f614abe6282 - trans::callee::trans_call_inner::h3254752094884955895
  15:     0x7f614abeffb7 - trans::expr::trans_rvalue_dps_unadjusted::hef8dfca3ed40ae1ayCi
  16:     0x7f614abaeb16 - trans::expr::trans_into::hfd1d86829031637bTph
  17:     0x7f614abade9e - trans::controlflow::trans_stmt_semi::h55989b37a84cb9a5I6d
  18:     0x7f614abaf56d - trans::controlflow::trans_block::h256c6adade2f2b19v7d
  19:     0x7f614abef5ca - trans::expr::trans_rvalue_dps_unadjusted::hef8dfca3ed40ae1ayCi
  20:     0x7f614abaeb16 - trans::expr::trans_into::hfd1d86829031637bTph
  21:     0x7f614abaf8c7 - trans::controlflow::trans_block::h256c6adade2f2b19v7d
  22:     0x7f614ac6b430 - trans::base::trans_closure::he79ea7f539d044908ot
  23:     0x7f614ab9ee8b - trans::base::trans_fn::hf8ffda1f6e15e21f1zt
  24:     0x7f614ab9ae36 - trans::base::trans_item::h1e743d406713e7f3TXt
  25:     0x7f614ab9afbc - trans::base::trans_item::h1e743d406713e7f3TXt
  26:     0x7f614ac71bdc - trans::base::trans_crate::h36583585edaa27744Tu
  27:     0x7f614bafb292 - driver::phase_4_translate_to_llvm::hcd9743fc2b81ca5dgOa
  28:     0x7f614bad6c8a - driver::compile_input::ha2891122eb1a39f0Nba
  29:     0x7f614bb9b31d - run_compiler::hc4e992049010d432N6b
  30:     0x7f614bb9908c - thunk::F.Invoke<A, R>::invoke::h14385132183911481449
  31:     0x7f614bb97ce0 - rt::unwind::try::try_fn::h10665785272209311867
  32:     0x7f614b5687b8 - rust_try_inner
  33:     0x7f614b5687a5 - rust_try
  34:     0x7f614bb9846b - thunk::F.Invoke<A, R>::invoke::h8207817643633544688
  35:     0x7f614b4e9ff5 - sys::thread::thread_start::hd01357c835e1f75claF
  36:     0x7f6145699b4f - start_thread
  37:     0x7f614b0ce7bc - <unknown>
rustc 1.0.0-dev (6048ba8a5 2015-03-10) (built 2015-03-11)
@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Mar 11, 2015
@frewsxcv
Copy link
Member

Is there code we can compile to try and reproduce/debug this error?

@mitaa
Copy link
Contributor

mitaa commented Aug 20, 2015

extern "Rust" {
    fn foo();
}

fn main() {
    unsafe { foo() };
}
error: internal compiler error: unimplemented foreign functions with Rust ABI
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', ../src/libsyntax/diagnostic.rs:253


playpen: application terminated with error code 101

@randomPoison
Copy link
Contributor

I ran into this issue when I did have the symbol defined, something like:

pub fn foo() {}

mod bar {
    extern "Rust" {
        fn foo();
    }

    pub fn bar() {
        foo();
    }
}

I would have expected this to work, though at least it shouldn't hit an ICE.

bltavares added a commit to bltavares/glacier that referenced this issue Oct 31, 2015
@steveklabnik
Copy link
Member

Triage: tracked by glacier. no change.

@Mark-Simulacrum
Copy link
Member

Neither example ICEs today; not sure why glacier didn't catch this... I believe this is statically impossible today; closing.

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