Skip to content

Unexpected panic when building with WebAssembly #47643

Closed

Description

@tversteeg

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`.

Activity

  1. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    O-wasmTarget: WASM (WebAssembly), http://webassembly.org/
    on Jan 21, 2018
  2. alexcrichton commented on Jan 22, 2018

    @alexcrichton
    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
  3. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    A-incr-compArea: Incremental compilation
    C-bugCategory: This is a bug.
    on Jan 27, 2018
  4. alexcrichton commented on Mar 6, 2018

    @alexcrichton
    Member

    Fixed by #48125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️O-wasmTarget: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions