{"record":{"id":"c4925253d94b1745","repo":"windmill-labs/windmill","slug":"oh-no","errorCode":null,"errorMessage":"oh no","messagePattern":"oh no","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-csharp/src/wasm_libc.rs","lineNumber":206,"sourceCode":"    _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!(\"asdasd\");\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":188,"sourceCodeEnd":208,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-csharp/src/wasm_libc.rs#L188-L208","documentation":"__assert_fail() — the C assert() failure handler — is stubbed in wasm_libc.rs to panic with the unhelpful message \"oh no\". When an assert() in WASM-compiled code fails, control lands here and the whole execution aborts. The generic message hides which assertion failed.","triggerScenarios":"A C assert(cond) compiled into the WASM module evaluates false, so the compiler-emitted call to __assert_fail(file, line, func, expr) fires.","commonSituations":"Debug-build native dependencies with asserts enabled running under the WASM parser; invariants violated in libc/glue code (null pointers, unexpected enum values, corrupted state); release flags changed so NDEBUG is no longer defined.","solutions":["Read the actual failure location from the WASM stack trace and fix the violated invariant in the calling code.","Build the native component with NDEBUG (release) so asserts are compiled out in WASM.","Improve the shim: implement __assert_fail in wasm_libc.rs to console_log the file/line/expression before panicking so future failures are diagnosable.","Fix the upstream condition that fails (often a null pointer or unsupported input reaching native glue)."],"exampleFix":"// before\npub extern \"C\" fn __assert_fail(_: *const i32, _: *const i32, _: *const i32, _: *const i32) {\n    panic!(\"oh no\");\n}\n// after\npub extern \"C\" fn __assert_fail(f: *const i32, l: *const i32, _: *const i32, e: *const i32) {\n    panic!(\"assert failed: {}:{}:{}\", read_cstr(f), read_cstr(l), read_cstr(e));\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  runInWasmParser(code);\n} catch (e) {\n  if (String(e?.message ?? e) === \"oh no\") {\n    // generic __assert_fail stub message: a C assert() failed in wasm\n    console.error(\"A C-level assert failed inside the wasm runtime; check the stack trace for file/line.\");\n  } else {\n    throw e;\n  }\n}","preventionTips":["Build native wasm components with NDEBUG so asserts compile out.","Improve the __assert_fail shim to log file/line/expression before panicking.","Treat \"oh no\" in logs as a failed C assert and inspect the wasm backtrace.","Validate inputs crossing into native glue to avoid tripping invariants."],"tags":["wasm","libc","csharp","assert","unsupported-symbol"],"backgroundTag":"unsupported-wasm-libc-symbol","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"}