second-state / wasmedge_wasi_socket

A Rust lib for socket on WasmEdge.
https://second-state.github.io/wasmedge_wasi_socket/
Apache License 2.0
70 stars 29 forks source link

Error in http_client main.rs #73

Closed JasonLou99 closed 1 year ago

JasonLou99 commented 1 year ago

Running http client example main.rs is giving an error

jason@webassembly120:~/wasm_storage$ cargo build --bin httpclient --target wasm32-wasi
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
jason@webassembly120:~/wasm_storage$ wasmedge ./target/wasm32-wasi/debug/httpclient.wasm
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: IO(Error { kind: WriteZero, message: "failed to write whole buffer" })', src/bin/httpclient.rs:12:73
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2022-11-10 23:12:21.926] [error] execution failed: unreachable, Code: 0x89
[2022-11-10 23:12:21.926] [error]     In instruction: unreachable (0x00) , Bytecode offset: 0x0006b1b7
[2022-11-10 23:12:21.926] [error]     When executing function name: "_start"

Thanks for your help.

MediosZ commented 1 year ago

Hi @JasonLou99, Thanks for reporting this! It seems that the error is caused by outdated http_req. Please update the wasmedge_http_req to 0.9.0. We will fix this in #74.

JasonLou99 commented 1 year ago

Thanks!