wacker-dev / waki

HTTP client and server library for WASI.
https://docs.rs/waki
Apache License 2.0
10 stars 0 forks source link

Tests fail with `misaligned pointer dereference: address must be a multiple of 0x8` #6

Closed GyulyVGC closed 4 months ago

GyulyVGC commented 4 months ago

I found out about your library this morning while I was facing a bunch of problems trying to use reqwest in a WIT-component-based environment.

This library fixes the issues I had like a charm and correctly works when I invoke the WIT exports in JavaScript.

However, I later tried to write down some tests in Rust to verify some simple HTTP requests, but they panic with the error misaligned pointer dereference: address must be a multiple of 0x8.

So I'm wondering whether this is a subtle bug or simply this library is not supposed to work in standard Rust.

I've also tried running my tests with --target wasm32-wasi but they don't even start.

iawia002 commented 4 months ago

What are your tests like, and how are they run? Theoretically, it can be tested because waki itself has integrated tests. However, unlike ordinary tests, it requires a special way to run:

  1. Write separate test programs.
  2. Compile the above programs into WASM files.
  3. Use wasmtime (or another runtime that supports WASI preview 2 API) to run these test programs.
GyulyVGC commented 4 months ago

Thank you so much for the directions. I was running them with cargo test just like ordinary tests. I'll take inspiration from your workflow 👍