Skip to content

Crash when rebooting emulator core #4629

@SuuperW

Description

@SuuperW

The following Lua script crashes EmuHawk when rebooting the core:

event.onexit(function()
	memory.read_u8(0)
end)

while true do
	emu.frameadvance()
end

This happens because the script is not stopped until LuaConsole.Restart, at which point the old core instance has been disposed. (Of course, even if the exit handler read from the new core, that would not be correct either.)

Repro

  1. Open a ROM with a core that supports memory API
  2. Start the above Lua script
  3. Reload the ROM

Output

No error message.

Host env.

BizHawk 2.11 and current master

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions