matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: Lua VM has no CPU/memory limits

Open andrinoff opened this issue 7 months ago • 2 comments

Describe the bug

The plugin Lua VM (plugin/plugin.go) has no execution time limit or memory cap. A plugin containing an infinite loop (while true do end) or excessive memory allocation will freeze the entire TUI with no way to recover other than killing the process.

To reproduce

  1. Create a plugin file ~/.config/matcha/plugins/freeze.lua:
local matcha = require("matcha")
matcha.on("startup", function()
    while true do end
end)
  1. Start matcha
  2. The TUI freezes permanently

Expected behavior

Plugin execution should have a timeout (e.g. 5 seconds per hook call) and/or a memory limit. When exceeded, the plugin should be terminated with an error logged and a user notification. Consider using gopher-lua's context cancellation support or an instruction count hook.

OS

All platforms

andrinoff avatar Apr 15 '26 19:04 andrinoff

This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.

floatpanebot avatar May 16 '26 05:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar May 30 '26 05:05 floatpanebot