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

'assertion failed: !self.dead.contains(&id)' panic since 0.2.46 #1613

Closed
MaulingMonkey opened this issue Jun 23, 2019 · 3 comments · Fixed by #1617
Closed

'assertion failed: !self.dead.contains(&id)' panic since 0.2.46 #1613

MaulingMonkey opened this issue Jun 23, 2019 · 3 comments · Fixed by #1617
Labels

Comments

@MaulingMonkey
Copy link

MaulingMonkey commented Jun 23, 2019

Describe the Bug

wasm-bindgen panics building MaulingMonkey/rust_wasm_sample@ff3bbed when invoked by wasm-pack build --dev with the following message:

C:\local\rust_wasm_sample>wasm-pack build --dev
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
   Compiling rust_wasm_sample v0.1.0 (C:\local\rust_wasm_sample)
    Finished dev [unoptimized + debuginfo] target(s) in 0.40s
thread 'main' panicked at 'assertion failed: !self.dead.contains(&id)', C:\Users\Mike\.cargo\registry\src\github.com-1ecc6299db9ec823\walrus-0.8.0\src\tombstone_arena.rs:139:9
stack backtrace:
   0: <unknown>
      ...
  19: <unknown>
  20: BaseThreadInitThunk
  21: RtlUserThreadStart
Error: Running the wasm-bindgen CLI
Caused by: failed to execute `wasm-bindgen`: exited with exit code: 101

This doesn't happen without --dev, possibly because the asserts are getting compiled out? I'm having trouble figuring out how to build wasm-bindgen from source to get symbols / a useful stack trace...

Steps to Reproduce

git clone https://github.com/MaulingMonkey/rust_wasm_sample.git
cd rust_wasm_sample
git checkout ff3bbedbcf3b717a0ae
:: Optionally, specify a specific version of wasm-bindgen in Cargo.toml
wasm-pack build --dev
Cargo.toml [dependencies] Result
wasm-bindgen = "=0.2.45" OK
wasm-bindgen = "=0.2.46" Panic
wasm-bindgen = "=0.2.47" Panic

Additional Context

wasm-pack version 0.8.1
rustc version rustc 1.35.0 (3c235d560 2019-05-20)
host toolchain stable-x86_64-pc-windows-msvc

Command line according to procmon, which I've confirmed also panics:

"%LOCALAPPDATA%\.wasm-pack\wasm-bindgen-a9955440c81117c8\wasm-bindgen.exe" C:\local\rust_wasm_sample\target\wasm32-unknown-unknown\debug\rust_wasm_sample.wasm --out-dir .\pkg --typescript --browser --debug
@lineCode
Copy link

I have the same issue

@spencercw
Copy link

I am getting the same panic, although I can't reproduce it with your example. It seems to happen when trying to use web-sys for me.

lib.rs:

use web_sys::console;

Dependencies:

wasm-bindgen = "=0.2.47"
web-sys = { version = "=0.3.24", features = ["console"] }

Build output:

$ RUST_BACKTRACE=1 wasm-pack build
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
    Finished release [optimized] target(s) in 0.07s
:-) [WARN]: origin crate has no README
[INFO]: Installing wasm-bindgen...
thread 'main' panicked at 'assertion failed: !self.dead.contains(&id)', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/walrus-0.8.0/src/tombstone_arena.rs:139:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::_print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::begin_panic
   6: <walrus::tombstone_arena::TombstoneArena<T> as core::ops::index::IndexMut<id_arena::Id<T>>>::index_mut
   7: wasm_bindgen_cli_support::js::Context::finalize
   8: wasm_bindgen_cli_support::Bindgen::_generate
   9: wasm_bindgen::main
  10: std::rt::lang_start::{{closure}}
  11: std::panicking::try::do_call
  12: __rust_maybe_catch_panic
  13: std::rt::lang_start_internal
  14: main
Error: Running the wasm-bindgen CLI
Caused by: failed to execute `wasm-bindgen`: exited with exit code: 101

alexcrichton added a commit to alexcrichton/wasm-bindgen that referenced this issue Jun 23, 2019
After a module goes through its primary GC pass we need to look over the
set of remaining imports and use that to prune the set of imports that
we're binding.

Closes rustwasm#1613
@alexcrichton
Copy link
Contributor

Thanks for the report, definitely a bug in the tooling! This should be fixed by #1617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants