checkDeadline in lib/scripting/lua_engine.dart:100 is only called from host functions (CanvasObject.new, __newindex, declareParams and so on). A script such as while true do end never calls the host, so it never returns, and there is no isolate, so it runs on the UI isolate and freezes the editor. Regeneration runs on move, paste and param edits, so a bad script saved into a file would hang again on reopen, and the agent can write and run scripts.
Evidence:test/review_probes/engine_lua_budget_probe.dart (local, untracked): timeout=20ms elapsed=602ms result=LuaRunSuccess for a bounded 3M iteration loop. string.rep("x", 20000000) also succeeds, so memory is unbounded. A truly infinite loop was not run.
Side find: #s on a string throws attempt to get length of a string value, which looks like a lua_dardo_plus bug.
Fix sketch: add an instruction count hook if the VM exposes one, otherwise run scripts in an isolate with a kill timeout. Cap or remove string.rep. Related: #38.
From the engineering review on 2026-10-13.
`checkDeadline` in `lib/scripting/lua_engine.dart:100` is only called from host functions (`CanvasObject.new`, `__newindex`, `declareParams` and so on). A script such as `while true do end` never calls the host, so it never returns, and there is no isolate, so it runs on the UI isolate and freezes the editor. Regeneration runs on move, paste and param edits, so a bad script saved into a file would hang again on reopen, and the agent can write and run scripts.
**Evidence:** `test/review_probes/engine_lua_budget_probe.dart` (local, untracked): `timeout=20ms elapsed=602ms result=LuaRunSuccess` for a bounded 3M iteration loop. `string.rep("x", 20000000)` also succeeds, so memory is unbounded. A truly infinite loop was not run.
Side find: `#s` on a string throws `attempt to get length of a string value`, which looks like a `lua_dardo_plus` bug.
**Fix sketch:** add an instruction count hook if the VM exposes one, otherwise run scripts in an isolate with a kill timeout. Cap or remove `string.rep`. Related: #38.
ImBenji
added the bug label 2026-10-13 02:28:38 +00:00
ImBenji
added this to the Arcs & Angles project 2026-10-13 02:28:38 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
From the engineering review on 2026-10-13.
checkDeadlineinlib/scripting/lua_engine.dart:100is only called from host functions (CanvasObject.new,__newindex,declareParamsand so on). A script such aswhile true do endnever calls the host, so it never returns, and there is no isolate, so it runs on the UI isolate and freezes the editor. Regeneration runs on move, paste and param edits, so a bad script saved into a file would hang again on reopen, and the agent can write and run scripts.Evidence:
test/review_probes/engine_lua_budget_probe.dart(local, untracked):timeout=20ms elapsed=602ms result=LuaRunSuccessfor a bounded 3M iteration loop.string.rep("x", 20000000)also succeeds, so memory is unbounded. A truly infinite loop was not run.Side find:
#son a string throwsattempt to get length of a string value, which looks like alua_dardo_plusbug.Fix sketch: add an instruction count hook if the VM exposes one, otherwise run scripts in an isolate with a kill timeout. Cap or remove
string.rep. Related: #38.