Closed
Description
The bug phenomenon and reproduce steps can be seen in this issue: WebAssembly/wasi-libc#389.
Briefly speaking, after rustc compilation, the exported wasm functions will be wrapped with wasi-ctor and wasi-dtor; but wasi-ctor is designed for being called only once during the whole wasi lifetime, and multiple executions will lead to memory leak (due to env-vars init process).
I used to try to fix this bug in wasi-libc repo (pr: WebAssembly/wasi-libc#390). The wasi-libc maintainers commented that code change was inappropriate, then I'm moving here and hoping for a functional and elegant solution.