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

Unexpected panic when building with WebAssembly #47643

Closed
tversteeg opened this issue Jan 21, 2018 · 2 comments
Closed

Unexpected panic when building with WebAssembly #47643

tversteeg opened this issue Jan 21, 2018 · 2 comments
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@tversteeg
Copy link
Contributor

tversteeg commented Jan 21, 2018

I'm trying to port the minifb crate to WebAssembly: repo.

The last code I added was:

extern crate lazy_static;

I tried to run the wasm.rs example with the following command:

export RUST_BACKTRACE=1 && cargo build --example wasm --target wasm32-unknown-unknown

I expected to see this happen: A reasonable error message.

Instead, this happened: I got an unexpected panic.

Meta

rustc --version --verbose:

rustc 1.25.0-nightly (15a1e2844 2018-01-20)
binary: rustc
commit-hash: 15a1e2844dfea7850be5c6c901b67ceff370b0eb
commit-date: 2018-01-20
host: x86_64-unknown-linux-gnu
release: 1.25.0-nightly
LLVM version: 4.0

Backtrace:

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `2`,
 right: `1`', librustc_trans/back/link.rs:1403:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
	     at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
	     at libstd/sys_common/backtrace.rs:68
	     at libstd/sys_common/backtrace.rs:57
   2: std::panicking::default_hook::{{closure}}
	     at libstd/panicking.rs:380
   3: std::panicking::default_hook
	     at libstd/panicking.rs:390
   4: std::panicking::rust_panic_with_hook
	     at libstd/panicking.rs:576
   5: std::panicking::begin_panic
	     at libstd/panicking.rs:537
   6: std::panicking::begin_panic_fmt
	     at libstd/panicking.rs:521
   7: rustc_trans::back::link::link_natively
   8: rustc_trans::back::link::link_binary
   9: <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::link_binary
  10: rustc_driver::driver::compile_input
  11: rustc_driver::run_compiler

error: Could not compile `minifb`.
@tversteeg tversteeg reopened this Jan 21, 2018
@sfackler sfackler added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-wasm Target: WASM (WebAssembly), http://webassembly.org/ labels Jan 21, 2018
@alexcrichton
Copy link
Member

Thanks for the report! This is due to the fact that wasm compilation isn't currently compatible with incremental compilation, and with incremental enabled wasm's not quite working yet and can cause this ICE. For now you can temporarily disable this with:

[profile.dev]
incremental = false

@cuviper cuviper added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. labels Jan 27, 2018
@alexcrichton
Copy link
Member

Fixed by #48125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants