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

thread 'main' panicked at 'unknown name section chunk type: 7' #251

Open
Badel2 opened this issue May 20, 2021 · 13 comments
Open

thread 'main' panicked at 'unknown name section chunk type: 7' #251

Badel2 opened this issue May 20, 2021 · 13 comments

Comments

@Badel2
Copy link

Badel2 commented May 20, 2021

After running cargo web, executing the wasm file results in this panic:

thread 'main' panicked at 'unknown name section chunk type: 7', src/wasm_context.rs:642:41

I fixed this in this commit: Badel2@46b3637

By replacing the panic with an error. Not sure if this has any consequences, but it seems to work.

If you encounter this problem you can use my fork:

cargo install --git https://github.com/Badel2/cargo-web cargo-web
@gabrielpacheco23
Copy link

gabrielpacheco23 commented Jun 1, 2021

I've encoutered this problem too... But unfortunately your workaround also didn't work.

@shaharyarahmed-bot
Copy link

I have also encountered this issue any solutions yet?

1 similar comment
@fengli0
Copy link

fengli0 commented Jun 21, 2021

I have also encountered this issue any solutions yet?

@NekoAlosama
Copy link

I have also encountered this issue any solutions yet?

anti-similar comment tactic

@jice-nospam
Copy link

Same issue with latest 0.6.26 version trying to recompile my project...

@7r3nzy
Copy link

7r3nzy commented Jan 8, 2022

I've encountered this issue with rust version > 1.51 <= 1.57. It works for me in 1.47 and 1.51(built successfully, but had runtime errors), not tested any other versions.

@7r3nzy
Copy link

7r3nzy commented Jan 10, 2022

this may be related koute/stdweb#411

@sotrh
Copy link

sotrh commented Apr 9, 2022

This is also an issue for me when working on https://github.com/sotrh/gamepads. I have a backtrace:

RUST_BACKTRACE=1 cargo web start > errors.txt
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
warning: unused variable: `id`
  --> src/main.rs:37:32
   |
37 |         while let Some(Event { id, event, time}) = context.next_event() {
   |                                ^^ help: try ignoring the field: `id: _`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `event`
  --> src/main.rs:37:36
   |
37 |         while let Some(Event { id, event, time}) = context.next_event() {
   |                                    ^^^^^ help: try ignoring the field: `event: _`

warning: unused variable: `time`
  --> src/main.rs:37:43
   |
37 |         while let Some(Event { id, event, time}) = context.next_event() {
   |                                           ^^^^ help: try ignoring the field: `time: _`

warning: 3 warnings emitted
    Processing "gamepads.wasm"...
thread 'main' panicked at 'unknown name section chunk type: 7', /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-web-0.6.26/src/wasm_context.rs:642:41
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
   1: std::panicking::begin_panic_fmt
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:460:5
   2: cargo_web::wasm_context::Context::from_module
   3: cargo_web::wasm::process_wasm_file
   4: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
   5: cargo_web::cargo_shim::BuildConfig::build_internal
   6: cargo_web::cargo_shim::BuildConfig::build
   7: cargo_web::build::Project::build_or_check
   8: cargo_web::cmd_start::LastBuild::new
   9: cargo_web::cmd_start::command_start
  10: cargo_web::run
  11: cargo_web::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@renatocassino
Copy link

Same problem here :/

$ RUST_BACKTRACE=1 cargo web build --target=wasm32-unknown-unknown
warning: unused manifest key: cargo-web
warning: unused manifest key: default-target
warning: unused manifest key: prepend-js
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
    Processing "wasm-test.wasm"...
thread 'main' panicked at 'unknown name section chunk type: 7', /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-web-0.6.26/src/wasm_context.rs:642:41
stack backtrace:
   0: rust_begin_unwind
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:143:14
   2: cargo_web::wasm_context::Context::from_module
   3: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
   4: cargo_web::cargo_shim::BuildConfig::build_internal
   5: cargo_web::cargo_shim::BuildConfig::build
   6: cargo_web::build::Project::build_or_check
   7: cargo_web::cmd_build::command_build_or_check
   8: cargo_web::run
   9: cargo_web::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I'm using in WSL2, is impossible to build a simple script

Someone can help me?

@JasonkayZK
Copy link

This issue still remains unsovled...

@shixish
Copy link

shixish commented Mar 13, 2023

I'm stuck on this error as well. I don't know what I'm doing. [Doge.jpg]
Encountered this while trying to run https://github.com/rustyscreeps/screeps-starter-rust 🤷

It says this... if it helps any:

    Processing "screeps-starter-rust.wasm"...
thread 'main' panicked at 'unknown name section chunk type: 7', C:\Users\Andrew\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-web-0.6.26\src\wasm_context.rs:642:41
stack backtrace:
   0:     0x7ff7341cb312 - <unknown>
   1:     0x7ff7341eee5b - <unknown>
   2:     0x7ff7341c2f6a - <unknown>
   3:     0x7ff7341cb05b - <unknown>
   4:     0x7ff7341cde39 - <unknown>
   5:     0x7ff7341cdabb - <unknown>
   6:     0x7ff7341ce6d0 - <unknown>
   7:     0x7ff7341ce45e - <unknown>
   8:     0x7ff7341cc00f - <unknown>
   9:     0x7ff7341ce110 - <unknown>
  10:     0x7ff73420ed25 - <unknown>
  11:     0x7ff733e530b8 - <unknown>
  12:     0x7ff733dea8e4 - <unknown>
  13:     0x7ff733e35843 - <unknown>
  14:     0x7ff733e04deb - <unknown>
  15:     0x7ff733e019d5 - <unknown>
  16:     0x7ff733e4be7a - <unknown>
  17:     0x7ff733e0648f - <unknown>
  18:     0x7ff733d301d3 - <unknown>
  19:     0x7ff733d03af6 - <unknown>
  20:     0x7ff733cf9c76 - <unknown>
  21:     0x7ff733cf9eec - <unknown>
  22:     0x7ff7341bb8be - <unknown>
  23:     0x7ff733d03e4c - <unknown>
  24:     0x7ff7341f6ef4 - <unknown>
  25:     0x7ff820ef55a0 - BaseThreadInitThunk
  26:     0x7ff82246485b - RtlUserThreadStart

shixish referenced this issue in shixish/screeps-starter-rust Mar 13, 2023
@Tom-CSTech
Copy link

I can't believe that a core dependency for many apps is just abandoned completely dead like this. It's sad to see.

@oluceps
Copy link

oluceps commented May 20, 2023

Likewise here. Is this project no longer maintained?

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

No branches or pull requests