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

panic in wasm-bindgen-cli #2803

Closed
felixwatts opened this issue Feb 15, 2022 · 1 comment
Closed

panic in wasm-bindgen-cli #2803

felixwatts opened this issue Feb 15, 2022 · 1 comment
Labels

Comments

@felixwatts
Copy link

felixwatts commented Feb 15, 2022

Describe the Bug

Panic during wasm-bindgen step of trunk build. See stack trace below.

Steps to Reproduce

  1. cargo install wasm-bindgen-cli --version 0.2.79
  2. cargo install trunk --version 0.14.0
  3. Ask me for access and then clone this repo: [email protected]:felixwatts/growlog-yew.git
  4. cd growlog-yew/client
  5. git checkout static_sql
  6. trunk build
  7. See error

Expected Behavior

trunk build completes without errors.

Actual Behavior

trunk build fails with a panic in wasm-bindgen. The output with RUST_BACKTRCE=full follows:

Feb 15 10:53:22.919  INFO calling wasm-bindgen
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', crates/cli-support/src/descriptor.rs:205:15
stack backtrace:
   0:           0x6ebef0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf42958820747a8ac
   1:           0x7221bc - core::fmt::write::h6f5ededa5074697e
   2:           0x6e97d5 - std::io::Write::write_fmt::hdb84dc6c28fda870
   3:           0x6ede6b - std::panicking::default_hook::{{closure}}::hb85a09d7e9a16432
   4:           0x6ed941 - std::panicking::default_hook::hdc924e74cb190bbb
   5:           0x6ee534 - std::panicking::rust_panic_with_hook::hd63b080e78590a80
   6:           0x6ee017 - std::panicking::begin_panic_handler::{{closure}}::h27bfba1f7e931f90
   7:           0x6ec38c - std::sys_common::backtrace::__rust_end_short_backtrace::h2cc025f6c95b1f82
   8:           0x6edf79 - rust_begin_unwind
   9:           0x4291a1 - core::panicking::panic_fmt::h9f5a85773697c5f5
  10:           0x429162 - core::panicking::panic_bounds_check::h70dd3fd6056304a0
  11:           0x45f9ea - wasm_bindgen_cli_support::descriptor::Descriptor::_decode::h9adc04c55179ba18
  12:           0x45f9bc - wasm_bindgen_cli_support::descriptor::Descriptor::_decode::h9adc04c55179ba18
  13:           0x45f9bc - wasm_bindgen_cli_support::descriptor::Descriptor::_decode::h9adc04c55179ba18
  14:           0x45fcce - wasm_bindgen_cli_support::descriptor::Function::decode::h81540754b760c003
  15:           0x45f58e - wasm_bindgen_cli_support::descriptor::Descriptor::_decode::h9adc04c55179ba18
  16:           0x48d079 - wasm_bindgen_cli_support::descriptors::execute::hf8840b1ee2325cbc
  17:           0x443c6d - wasm_bindgen_cli_support::Bindgen::generate_output::h9b68d0f02d04575e
  18:           0x42a72e - wasm_bindgen_cli_support::Bindgen::generate::h0bb72b73165f8801
  19:           0x42dda0 - wasm_bindgen::main::h68109d2e2053b319
  20:           0x42beb3 - std::sys_common::backtrace::__rust_begin_short_backtrace::he92ef7ccf1d60268
  21:           0x42bec9 - std::rt::lang_start::{{closure}}::h1aac00108137e691
  22:           0x6eea90 - std::rt::lang_start_internal::hfee0032b3594c35b
  23:           0x42e1a2 - main
Feb 15 10:53:23.818 ERROR ❌ error
error from HTML pipeline

Caused by:
    0: error from asset pipeline
    1: wasm-bindgen call returned a bad status

Stack backtrace:
   0: anyhow::error::<impl anyhow::Error>::msg
   1: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   2: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   3: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   5: tokio::runtime::task::harness::poll_future
   6: tokio::runtime::task::raw::poll
   7: tokio::runtime::thread_pool::worker::Context::run_task
   8: tokio::runtime::task::raw::poll
   9: std::sys_common::backtrace::__rust_begin_short_backtrace
  10: core::ops::function::FnOnce::call_once{{vtable.shim}}
  11: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/ac50a53359328a5d7f2f558833e63d59d372e4f7/library/alloc/src/boxed.rs:1636:9
  12: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/ac50a53359328a5d7f2f558833e63d59d372e4f7/library/alloc/src/boxed.rs:1636:9
  13: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/ac50a53359328a5d7f2f558833e63d59d372e4f7/library/std/src/sys/unix/thread.rs:106:17
  14: start_thread
             at ./nptl/./nptl/pthread_create.c:435:8
  15: __clone
             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:100
Error: error from HTML pipeline

Caused by:
    0: error from asset pipeline
    1: wasm-bindgen call returned a bad status

Stack backtrace:
   0: anyhow::error::<impl anyhow::Error>::msg
   1: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   2: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   3: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   5: tokio::runtime::task::harness::poll_future
   6: tokio::runtime::task::raw::poll
   7: tokio::runtime::thread_pool::worker::Context::run_task
   8: tokio::runtime::task::raw::poll
   9: std::sys_common::backtrace::__rust_begin_short_backtrace
  10: core::ops::function::FnOnce::call_once{{vtable.shim}}
  11: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/ac50a53359328a5d7f2f558833e63d59d372e4f7/library/alloc/src/boxed.rs:1636:9
  12: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/ac50a53359328a5d7f2f558833e63d59d372e4f7/library/alloc/src/boxed.rs:1636:9
  13: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/ac50a53359328a5d7f2f558833e63d59d372e4f7/library/std/src/sys/unix/thread.rs:106:17
  14: start_thread
             at ./nptl/./nptl/pthread_create.c:435:8
  15: __clone
             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:100

Additional Context

This was working until recently. I made some code changes and this problem arose. I have so far been unable to isolate which code change triggered it.

I originally raised trunk-rs/trunk#318 but they told me its a problem with wasm-bindgen

@felixwatts felixwatts added the bug label Feb 15, 2022
@felixwatts
Copy link
Author

This turned out to be a duplicate of #2776 , it was NOT fixed by upgrading cli and dependency to 0.2.79, but WAS fixed by downgrading both to 0.2.78, which aslo required downgrading some other dependencies including web-sys, js-sys, wasm-bindgen-futures.

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

No branches or pull requests

1 participant