#Potential memory corruption in wasm (wasi/wasm32) for a plugin running in wasm host in envoy

1 messages · Page 1 of 1 (latest)

spiral fossil
#

It might be a clumsy title but looking for some pointers regarding the behavior I'm observing in a filter I'm developing for envoy in Zig. I'm working with a rudimentary implementation of the proxy-wasm spec (0.2.0) for Zig which uses a global variable for keeping the plugin's state. From what I can tell, between calls (host->vm, host is the wasm host, vm is me - the plugin), some state allocated dynamically gets overwritten.
I played around with optimization modes (ReleaseSafe vs Debug) to no avail and with allocators (page_allocator vs wasm_allocator vs arena_allocator (based on either of the former 2 ) also to no avail.
I only found this issue on GH which resembles my behavior but it's not emscripten.
Looking for any hints on how to troubleshoot. Can provide a link to the source if necessary.
Thanks!

GitHub

Zig Version 0.12.0-dev.668+c07d6e4c1 Targets tested on Windows (no crash issue) Web Opening 3d Raylib game locks up after 5-15 seconds when running WebAssembly build. Sometimes I notice printed tex...

#

Also tried with various Zig releases - 0.13.0 and the nightly from 17 Oct.