When using memory.registerexec, if a lua error is thrown within it, FCEUX crashes. Such as the following example that misspells 'memory.readbyte'. Lua will say it cannot find 'memory.readbyre' and crash.
local function test() memory.registerexec(0xFF2A,function() memory.readbyre(0x100) end) end while true do test() emu.frameadvance() end