windmill-labs/windmill · error
snprintf is not supported
Error message
snprintf is not supported
What it means
`snprintf` is a libc export stubbed with an unconditional panic in the WASM Ruby parser. Formatted-output paths in linked C code that resolve to `snprintf` abort with this message, signaling the sandbox does not implement C stdio formatting.
Source
Thrown at backend/parsers/windmill-parser-ruby/src/wasm_libc.rs:287
#[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 gems whose native code calls snprintf in the parse path
- Use pure-Ruby string formatting instead
- Implement a real snprintf shim (or vendor a wasm-compatible libc) if the dependency cannot be avoided
Defensive patterns
Strategy: validation
Validate before calling
// gate native-extension gems known to call snprintf
if deps.iter().any(|d| d.is_native_extension()) {
warn("native extensions may hit unsupported libc stubs (snprintf) in the wasm parser");
} Try / catch
std::panic::catch_unwind(|| parse_ruby(source))
.map_err(|e| sandbox_unsupported_error("snprintf", e)) Prevention
- Favor pure-Ruby implementations in the parser sandbox
- Test each new gem against the wasm parser before shipping
- Keep a list of supported/unsupported libc exports for script authors
When it happens
Trigger: Calling the exported no-argument `snprintf` symbol, or C-extension code inside the sandbox calling `snprintf`.
Common situations: Gems with native extensions performing buffered formatted output while the Ruby parser runs under wasm.
Related errors
- fclose is not supported
- fwrite is not supported
- vsnprintf is not supported
- clock_gettime is not supported
- clock is not supported
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/f4afee77df80b54e.
Report an issue: GitHub.