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

  1. Avoid gems whose native code calls snprintf in the parse path
  2. Use pure-Ruby string formatting instead
  3. 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

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


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/f4afee77df80b54e. Report an issue: GitHub.