subwasm icon indicating copy to clipboard operation
subwasm copied to clipboard

error loading wasm after rust toolchain update compiler

Open dzmitry-lahoda opened this issue 1 year ago • 6 comments

 RUST_BACKTRACE=1 nix run github:andresilva/polkadot.nix#subwasm --  metadata result/lib/runtime.optimized.wasm  --format scale > out.txt

test.zip

🗣️ If you think it should have worked, please open an issue at https://github.com/chevdor/subwasm/issues
and attach your runtime and mention using subwasmlib v0.20.0
The source was "result/lib/runtime.optimized.wasm" 

dzmitry-lahoda avatar Nov 15 '23 20:11 dzmitry-lahoda

Hash Error
Error: 
   0: Generic error: Failed loading runtime

Location:
   cli/src/main.rs:101

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 3 frames hidden ⋮                               
   4: subwasm::main::he999dfba082e9974
      at <unknown source file>:<unknown line>
   5: std::sys_common::backtrace::__rust_begin_short_backtrace::hcdb697a2b8a0db9e
      at <unknown source file>:<unknown line>
   6: std::rt::lang_start::{{closure}}::h97a0e80dd1689db2
      at <unknown source file>:<unknown line>
   7: std::rt::lang_start_internal::h7910e71d80e7bec3
      at <unknown source file>:<unknown line>
   8: main<unknown>
      at <unknown source file>:<unknown line>
   9: __libc_start_call_main<unknown>
      at <unknown source file>:<unknown line>
  10: __libc_start_main_impl<unknown>
      at <unknown source file>:<unknown line>
  11: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.

So is it possible to expand error to full? Whole trace/message of Hash?

dzmitry-lahoda avatar Nov 15 '23 20:11 dzmitry-lahoda

Weird is that how HashError happens? Why hashing fails?

dzmitry-lahoda avatar Nov 15 '23 20:11 dzmitry-lahoda

and attach your runtime

chevdor avatar Nov 16 '23 08:11 chevdor

it is inside archieve. gh does not allow to upload wasm exfensions

dzmitry-lahoda avatar Nov 16 '23 09:11 dzmitry-lahoda

test.zip

dzmitry-lahoda avatar Nov 16 '23 09:11 dzmitry-lahoda

it is unoptimized wasm btw. so optimized fails same way. fails on several new rust versions.

dzmitry-lahoda avatar Nov 16 '23 09:11 dzmitry-lahoda

I also had this issue and it was happening because the start of the wasm was not the WASM Magic bytes.

https://blog.ttulka.com/learning-webassembly-2-wasm-binary-format/

wilwade avatar Aug 22 '24 15:08 wilwade

Closing as it sounds like the wasm was not generated properly. Please reopen if you think this is wrong and include how you built the wasm.

chevdor avatar Aug 22 '24 16:08 chevdor