windmill-labs/windmill · error
fputs is not supported
Error message
fputs is not supported
What it means
The `fputs` stub in the WASM libc shim panics unconditionally. `fputs` writes a string to a C file stream; since the sandbox exposes no real stream objects, the library exports the symbol purely for link compatibility and treats any runtime call as an unsupported operation.
Source
Thrown at backend/parsers/windmill-parser-java/src/wasm_libc.rs:155
}
/* --------------------------------- ctype.h -------------------------------- */
#[no_mangle]
pub unsafe extern "C" fn isprint(c: c_int) -> bool {
c >= 32 && c <= 126
}
/* --------------------------------- stdio.h -------------------------------- */
#[no_mangle]
pub unsafe extern "C" fn fprintf(_file: *mut c_void, _format: *const c_void, _args: ...) -> c_int {
panic!("fprintf is not supported");
}
#[no_mangle]
pub unsafe extern "C" fn fputs(_s: *const c_void, _file: *mut c_void) -> c_int {
panic!("fputs is not supported");
}
#[no_mangle]
pub unsafe extern "C" fn fputc(_c: c_int, _file: *mut c_void) -> c_int {
panic!("fputc is not supported");
}
#[no_mangle]
pub unsafe extern "C" fn fdopen(_fd: c_int, _mode: *const c_void) -> *mut c_void {
panic!("fdopen is not supported");
}
#[no_mangle]
pub unsafe extern "C" fn fclose(_file: *mut c_void) -> c_int {
panic!("fclose is not supported");
}
#[no_mangle]View on GitHub (pinned to e474e8803c)
Solutions
- Remove or replace the fputs call in the code compiled into the module (use console_log! for diagnostics).
- Check for a newer windmill-parser-java version where the triggering component avoids stdio.
- Alter the parse input so the fputs-emitting path is not reached.
- Request a stdout-shim implementation upstream if the call site is third-party and unavoidable.
Example fix
// before
fputs("done\n", stdout);
// after
console_log!("done"); Defensive patterns
Strategy: try-catch
Validate before calling
if (!input || typeof input !== 'string') throw new Error('invalid parser input'); Try / catch
try {
const result = parse(input);
} catch (e) {
if (String(e).includes('fputs is not supported')) {
throw new Error('native component attempted fputs; unsupported in parser WASM');
}
throw e;
} Prevention
- Route all native output through the shim's console_log! macro.
- Grep bundled C/native sources for fputs before building the WASM module.
- Keep parser inputs within the constructs the supported code paths handle.
- Track wasm_libc.rs stubs to know which symbols are link-only.
When it happens
Trigger: Code inside the parser's WASM module calls `fputs(s, stream)` — typically plain-string output to stdout/stderr or to a file opened in the native component.
Common situations: A native/C dependency emitting unformatted output; transpiled Java/native helpers printing progress or results; code paths that open and write pseudo-files inside the sandbox.
Related errors
- fprintf is not supported
- fputc is not supported
- fwrite is not supported
- fprintf is not supported
- fputs is not supported
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/5ff1e53887e2363f.
Report an issue: GitHub.