Repository navigation
Unexpected panic when building with WebAssembly #47643
Copy link
Copy link
Closed
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
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`.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Activity
alexcrichton commentedon Jan 22, 2018
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:
alexcrichton commentedon Mar 6, 2018
Fixed by #48125