-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
memory leak in wasm32-wasi reactor mode #108381
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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.