Skip to main content

Module env_io

Module env_io 

Source
Expand description

Host output channel for the eval-mode module.

PRINT / DISPLAY / NEWLINE / DEBUG lower to a call into the env.log import ((i32 level, i32 ptr, i32 len) -> ()), reading the message from the guest’s exported linear memory. Script mode wires this in scripting::host; the rpc Session path needs the same import or those natives can’t compile. Output is routed to tracing (the rpc channel has no separate stdout) — same sink and level mapping as the script-mode host.

Functions§

register
register_silent
Links a NO-OP env.log for the render surface. Eval-mode modules always import env.log (PRINT/DISPLAY/DEBUG lower to it), so the import must resolve — but a template is untrusted source with no legitimate output channel, so render discards the message entirely: no per-request buffer append, no tracing tee. This closes the log-flood / unbounded-host-memory side channel a real env.log would hand an attacker-controlled template.