windmill-labs/windmill · error
vsnprintf is not supported
Error message
vsnprintf is not supported
What it means
`vsnprintf` (variadic formatted print into a buffer) is another libc function the WASM Ruby parser deliberately does not implement; its `#[no_mangle]` export panics unconditionally. Formatting machinery in the Ruby VM or linked C code that reaches vsnprintf aborts here.
Source
Thrown at backend/parsers/windmill-parser-ruby/src/wasm_libc.rs:276
#[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!("clock_gettime is not supported");
}
// 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
- Avoid C-extension gems that rely on printf-family formatting inside the parser sandbox
- Use pure-Ruby formatting (String#%, String#format equivalents) which does not descend into libc
- Provide a working vsnprintf shim compiled for wasm32 if such gems must be supported
Defensive patterns
Strategy: validation
Validate before calling
// detect C-extension dependencies that may invoke printf-family libc calls
let risky = manifest.dependencies.iter()
.any(|d| d.is_native_extension() && NATIVE_FORMAT_GEMS.contains(&d.name.as_str()));
if risky { warn("gem may call unsupported libc formatting in the wasm parser"); } Try / catch
std::panic::catch_unwind(|| parse_ruby(source)).unwrap_or_else(|e| {
Err(sandbox_unsupported_error("vsnprintf", e))
}) Prevention
- Prefer pure-Ruby gems in parser-executed code
- Avoid sprintf-heavy native gems inside the sandbox
- Track which libc shims the parser implements before adding dependencies
When it happens
Trigger: Calling the exported `vsnprintf` symbol, or a code path in the VM/gems that formats strings through C stdio (`printf`-family internals).
Common situations: Ruby formatting (sprintf/String#%) routed into libc internals inside the wasm sandbox; typically triggered by gems with C extensions.
Related errors
- fclose is not supported
- fwrite is not supported
- clock_gettime is not supported
- snprintf is not supported
- clock is not supported
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/00ab051cf644e925.
Report an issue: GitHub.