windmill-labs/windmill · critical

Aborted from C

Error message

Aborted from C

What it means

abort() in the Ruby parser WASM libc shim (backend/parsers/windmill-parser-ruby/src/wasm_libc.rs:15) is re-exported so the compiled Ruby parser links; when the embedded C/Ruby runtime calls C abort(), the shim panics with 'Aborted from C'. This means the WASM guest deliberately aborted execution — usually after detecting an unrecoverable internal error (failed assert, out-of-memory in the guest heap, or an explicit C abort call).

Source

Thrown at backend/parsers/windmill-parser-ruby/src/wasm_libc.rs:15

use std::collections::BTreeMap;
use std::sync::{Mutex, OnceLock};
use std::{
    alloc::{self, Layout},
    ffi::{c_char, c_int, c_void},
    mem::align_of,
    ptr,
};
use wasm_bindgen::prelude::*;

/* -------------------------------- stdlib.h -------------------------------- */

#[no_mangle]
pub unsafe extern "C" fn abort() {
    panic!("Aborted from C");
}

macro_rules! console_log {
    ($($t:tt)*) => (unsafe { log(&format_args!($($t)*).to_string()) })
}

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen(js_namespace = console)]
    fn log(a: &str);
}

#[no_mangle]
pub unsafe extern "C" fn malloc(size: usize) -> *mut c_void {
    if size == 0 {
        return ptr::null_mut();
    }

View on GitHub (pinned to e474e8803c)

Solutions

  1. Reduce/simplify the Ruby input to find the construct that aborts the parser and remove or rework it
  2. Increase the WASM memory limit / parser resources if the abort is guest OOM (check the runtime configuration hosting the parser)
  3. Upgrade windmill-parser-ruby or the bundled Ruby parser build to a version fixing the aborting path
  4. Capture the WASM backtrace and report the triggering input upstream
Defensive patterns

Strategy: try-catch

Validate before calling

// Guard the Ruby parser entry point:
if (typeof rubySource !== 'string') throw new TypeError('rubySource must be a string');
if (rubySource.length > MAX_PARSE_SIZE) throw new Error('Input too large for WASM parser');

Type guard

function isAbortFromC(e) {
  return e instanceof Error && e.message === 'Aborted from C';
}

Try / catch

try {
  const ast = rubyParser.parse(rubySource);
} catch (e) {
  if (isAbortFromC(e)) {
    return null; // guest aborted; surface a clean 'unparseable' result
  }
  throw e;
}

Prevention

When it happens

Trigger: The compiled Ruby parser WASM calls C abort(): a guest-side assertion failure, guest heap allocation failure caught by the runtime, or an explicit abort() in the embedded interpreter's C code.

Common situations: Parsing pathological Ruby input that drives the interpreter into a fatal path; guest memory exhaustion inside the WASM sandbox; parser runtime bugs under specific Ruby syntax.

Related errors


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