wasi-libc
wasi-libc copied to clipboard
WASI libc implementation for WebAssembly
This change runs the pthread tests available in `libc-test` when `THREAD_MODEL=posix`. This is currently a work-in-progress, since there are custom build steps necessary to get this all to (mostly) work....
That enables VMs to implement stack overflow detection or using passes like https://github.com/WebAssembly/binaryen/blob/main/src/passes/StackCheck.cpp See https://github.com/WebAssembly/wasi-threads/issues/12
Other PRs have fixed issues with malloc not being the only code that may use the `memory.grow` instruction (#377, #394). This merge requests fixes some issues that can occur when...
Tested on Linux with `wasmtime` `v9.0.1` and `wasi-sdk-20.0`. The following code (saved as `open-rw.c`) tries to open a file (that exists) for reading and writing: ```c #include #include int main()...
Sorry if this is the wrong repo for this issue, I guess it is more related to LLVM but I am finding it through analysis of wasi-libc and WebAssembly threads...
The memory returned from mmap is supposed to be page aligned. The file offset passed in is also required to be page aligned.
Currently wasi-libc makes errno a globally visible thread-local variable: https://github.com/WebAssembly/wasi-libc/blob/38f48942fabf1b59e73bca126340b219fa9a78aa/libc-bottom-half/cloudlibc/src/libc/errno/errno.c#L87 This differs from most other platforms - including underlying musl libc https://github.com/WebAssembly/wasi-libc/blob/38f48942fabf1b59e73bca126340b219fa9a78aa/libc-top-half/musl/include/errno.h#L10-L21 - that define `errno` as just a macro...
This is a program which spawns N threads. Each thread will then, M times, spawn a thread and join the thread. This is intended to exercise concurrently spawning threads. ```c...
This example program is intended to allocate 4 wasm pages of memory: ```cpp #include #include int main() { std::vector v; for (int i = 0; i < 65536; i++) {...
It seems that in the pthread builds, dlmalloc locks are not enabled, and this makes the libc allocator not thread-safe to use.