-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standalone: implement getentropy() via wasi_snapshot_preview1.random_get() #22782
Comments
Yes, I think that would make sense. There is a simple implementation in wasi-libc already: https://github.com/WebAssembly/wasi-libc/blob/main/libc-bottom-half/sources/getentropy.c Would you like the send a PR? I imagine the hardest part would be figuring out where/how to test it. |
martijneken
added a commit
to martijneken/proxy-wasm-cpp-sdk
that referenced
this issue
Oct 26, 2024
Issue: emscripten-core/emscripten#22782 Signed-off-by: Martijn Stevenson <[email protected]>
martijneken
added a commit
to martijneken/proxy-wasm-cpp-sdk
that referenced
this issue
Oct 26, 2024
Issue: emscripten-core/emscripten#22782 Signed-off-by: Martijn Stevenson <[email protected]>
mpwarres
pushed a commit
to proxy-wasm/proxy-wasm-cpp-sdk
that referenced
this issue
Oct 28, 2024
* fix: Implement getentropy while Emscripten gets patched Issue: emscripten-core/emscripten#22782 Signed-off-by: Martijn Stevenson <[email protected]>
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Oct 31, 2024
This allows it to work in standalone mode. Fixes: emscripten-core#22782
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Oct 31, 2024
This allows it to work in standalone mode. Fixes: emscripten-core#22782
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Oct 31, 2024
This allows it to work in standalone mode. Fixes: emscripten-core#22782
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Oct 31, 2024
This allows it to work in standalone mode. Fixes: emscripten-core#22782
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Oct 31, 2024
This allows it to work in standalone mode. Fixes: emscripten-core#22782
sbc100
added a commit
to sbc100/emscripten
that referenced
this issue
Nov 1, 2024
This allows it to work in standalone mode. Fixes: emscripten-core#22782
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please include the following in your bug report:
Version of emscripten/emsdk: 3.1.67 (and likely latest)
Failing command line in full:
Compiling absl::random code in standalone mode results in a wasm module that crashes. Sample code:
The reason is that Abseil under Emscripten uses the
getentropy()
syscall as a seed: https://github.com/abseil/abseil-cpp/blob/07fff76ed619672bb7bf00939231ba45aef2b043/absl/random/internal/seed_material.cc#L60-L64And standalone Emscripten defaults to a crashing implementation:
emscripten/system/lib/standalone/standalone.c
Lines 139 to 143 in b53978e
Would it be reasonable to use
wasi_snapshot_preview1.random_get()
to implementgetentropy()
?The text was updated successfully, but these errors were encountered: