windmill-labs/windmill · error
vsnprintf is not supported
Error message
vsnprintf is not supported
What it means
vsnprintf() is a stub that panics with "vsnprintf is not supported" in wasm_libc.rs. Formatted printing into a caller buffer via a va_list is unimplemented in the WASM shim, so any runtime path that formats into a buffer aborts. (Note the adjacent clock_gettime stub also panics with the nonsense string "asdasd", indicating this shim area is rough.)
Source
Thrown at backend/parsers/windmill-parser-csharp/src/wasm_libc.rs:190
#[no_mangle]
pub unsafe extern "C" fn fwrite(
_ptr: *const c_void,
_size: usize,
_nmemb: usize,
_stream: *mut c_void,
) -> usize {
panic!("fwrite is not supported");
}
#[no_mangle]
pub unsafe extern "C" fn vsnprintf(
_buf: *mut c_char,
_size: usize,
_format: *const c_char,
_args: ...
) -> c_int {
panic!("vsnprintf is not supported");
}
#[no_mangle]
pub extern "C" fn clock_gettime(ptr: usize, new_size: usize) {
panic!("asdasd");
}
// int snprintf( char* restrict buffer, size_t bufsz, const char* restrict format, ... );
#[no_mangle]
pub extern "C" fn snprintf() {
panic!("snprintf is not supported");
}
#[no_mangle]
pub extern "C" fn __assert_fail(_: *const i32, _: *const i32, _: *const i32, _: *const i32) {
panic!("oh no");
}
View on GitHub (pinned to e474e8803c)
Solutions
- Disable the logging/formatting path that uses vsnprintf in the WASM build.
- Implement vsnprintf in wasm_libc.rs supporting the subset of format specifiers actually used.
- Replace with a Rust-side formatter (format_args!) before crossing into libc.
- Pin/choose a runtime build whose formatting avoids vsnprintf imports.
Example fix
// before
vsnprintf(buf, sizeof(buf), fmt, args);
// after
let s = format!("{}", format_args_line(fmt, args)); // Rust-side formatting
buf.copy_from_slice(s.as_bytes()); Defensive patterns
Strategy: validation
Validate before calling
// Reject code paths that format via vsnprintf when targeting wasm:
if (isWasmHost && usesVsnprintf(nativeDeps)) {
throw new Error("Dependency formats with vsnprintf; unsupported in the wasm C# parser.");
} Try / catch
try {
runInWasmParser(code);
} catch (e) {
if (String(e?.message ?? e).includes("vsnprintf is not supported")) {
console.warn("vsnprintf is unimplemented in the wasm shim; format on the managed side.");
} else {
throw e;
}
} Prevention
- Format strings with managed .NET APIs instead of libc printf family in wasm.
- Implement a minimal vsnprintf in wasm_libc.rs if a small specifier subset suffices.
- Watch runtime upgrades for new libc imports (snprintf/vsnprintf) and test them.
- Prefer Rust-side format_args! helpers when writing glue for the wasm host.
When it happens
Trigger: Code calls vsnprintf(buf, size, format, args) — typically via vsnprintf-based logging wrappers or vasprintf-style helpers — inside the WASM runtime.
Common situations: Logging frameworks built on vprintf/vsnprintf in native deps; error-message formatting in C glue code; a runtime version change that newly pulls vsnprintf into the import list.
Related errors
- snprintf is not supported
- clock is not supported
- fprintf is not supported
- fputs is not supported
- fputc is not supported
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/93fa8996accb54dc.
Report an issue: GitHub.