Stream: general

Topic: Why does an empty Rust module requires fd_write?


view this post on Zulip Piotr Sarnacki (Oct 09 2023 at 07:26):

Hi, I'm testing wasmtime with modules compiled with Rust for wasm32-wasi target. One thing that is confusing is that an empty module (just an empty main() {}) function seems to require wasi_snapshot_preview1::fd_write. Is there any way to check what does it need it for? I'd be guessing stdin, but just wanted to confirm somehow

view this post on Zulip bjorn3 (Oct 09 2023 at 07:44):

That is probably a potential panic in the libstd initialization code. Libstd does various kinds of initialization which could fail if the environment misbehaves. In that case it will panic, which prints a message to stderr.


Last updated: Oct 23 2024 at 20:03 UTC