Closed
Description
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:
absl::BitGen bitgen;
int digit = absl::Uniform(bitgen, 0, 2);
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-L64
And 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 implement getentropy()
?
Metadata
Metadata
Assignees
Labels
No labels