{"record":{"id":"f4afee77df80b54e","repo":"windmill-labs/windmill","slug":"snprintf-is-not-supported-f4afee","errorCode":null,"errorMessage":"snprintf is not supported","messagePattern":"snprintf is not supported","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-ruby/src/wasm_libc.rs","lineNumber":287,"sourceCode":"#[no_mangle]\npub unsafe extern \"C\" fn vsnprintf(\n    _buf: *mut c_char,\n    _size: usize,\n    _format: *const c_char,\n    _args: ...\n) -> c_int {\n    panic!(\"vsnprintf is not supported\");\n}\n\n#[no_mangle]\npub extern \"C\" fn clock_gettime(ptr: usize, new_size: usize) {\n    panic!(\"clock_gettime is not supported\");\n}\n\n// int snprintf( char* restrict buffer, size_t bufsz, const char* restrict format, ... );\n#[no_mangle]\npub extern \"C\" fn snprintf() {\n    panic!(\"snprintf is not supported\");\n}\n\n#[no_mangle]\npub extern \"C\" fn __assert_fail(_: *const i32, _: *const i32, _: *const i32, _: *const i32) {\n    panic!(\"oh no\");\n}\n","sourceCodeStart":269,"sourceCodeEnd":294,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-ruby/src/wasm_libc.rs#L269-L294","documentation":"`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.","triggerScenarios":"Calling the exported no-argument `snprintf` symbol, or C-extension code inside the sandbox calling `snprintf`.","commonSituations":"Gems with native extensions performing buffered formatted output while the Ruby parser runs under wasm.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// gate native-extension gems known to call snprintf\nif deps.iter().any(|d| d.is_native_extension()) {\n    warn(\"native extensions may hit unsupported libc stubs (snprintf) in the wasm parser\");\n}","typeGuard":null,"tryCatchPattern":"std::panic::catch_unwind(|| parse_ruby(source))\n    .map_err(|e| sandbox_unsupported_error(\"snprintf\", e))","preventionTips":["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"],"tags":["wasm","ruby","libc","unsupported-operation"],"backgroundTag":"wasm-unsupported-libc-call","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}