Hello! My goal is to have Ableset ping a couple Mio on stage every two seconds to monitor their health and provide latency information in my Canvas. I’ve gotten it working conceptually but when I flood the network with messages, the MIDI Mapping script on a busy input eventually kills the whole script runner and nothing scripted works again until AbleSet is relaunched.
To further explain, a MIDI Mapping script sits on an RTP input carrying about 24 messages/second of ordinary show automation. After roughly 40 minutes:
RangeError: Maximum call stack size exceeded
at emscripten-module.1e0c139d.wasm:wasm-function[866]:0x479da
at emscripten-module.1e0c139d.wasm:wasm-function[602]:0x2bb3e
...
scriptName: "Network TO VFX / Ctrl Ping"
From that moment, every attempt to create a script context fails:
RuntimeError: null function
at emscripten-module.1e0c139d.wasm:wasm-function[694]:0x353ef
at t._QTS_NewContext [as QTS_NewContext] (672.js:1:8673)
at R.newContext (226.js:5:2785)
at U.newContext (226.js:6:1257)
at script-runner-44735674ee233813.js:1:11350
36,724 times over the next 25 minutes. No MIDI Mapping script runs, the Project Script stops, and its setIntervaltimers never fire again. Quitting and relaunching AbleSet is the only way back to normal operation.
Here are the rates I’ve logged
| window | MIDI in | VMs created | script errors |
|---|---|---|---|
| before the load increase | 3.0 | 3.0 | 0 |
| after, up to the crash | 26.0 | 26.0 | 0 |
| after the crash | 23.6 | 0 | 23.6 |
VM creation tracks inbound MIDI exactly 1:1. It looks like a fresh QuickJS context is created for every message arriving on an input that has a script mapping, before the script can decide whether it cares. My script’s first line is a channel check that rejects the other 99% of traffic, but the context has already been built by then.
Crash came at t=5524 s into a 7029 s session, so about 92 minutes in, or roughly 85,000 contexts.
The Project Script publishes each machine’s transport state to the other so a canvas on either one shows both, and it drives a MIDI path monitor that pings our three MIO boxes and watches the round trip. When the runtime dies, that monitor silently freezes — the last values just sit there looking healthy.
My questions for you are
Is a QuickJS context per incoming MIDI message intended? A channel or CC pre-filter on script mappings would avoid the majority of them, and would be useful regardless of this bug.
Is there any way for a script to recover the runtime? My watchdog was a setInterval in the Project Script, which of course dies with everything else.
Anything I can do on my end short of removing the script mappings?
Will send logs to the support inbox as well - thank you for your help, really appreciate you!
