TASEmulators / TASEmulators/BizHawk
Crash when rebooting emulator core
- Dominant language
- C#
- Stars
- 2.8k
- Forks
- 468
- PR merge metrics
- No merged PRs in 30d
Description
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
- Open a ROM with a core that supports memory API
- Start the above Lua script
- Reload the ROM
Output
No error message.
Host env.
BizHawk 2.11 and current master
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the LuaConsole.Restart path and the event.onexit and memory API behavior described in the report. Review pull request #4638 for the work already underway, then reproduce the script while reloading the ROM. Done means the emulator does not crash and reports the failure appropriately when the exit handler accesses the disposed core.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, lua
- Domain
- desktop, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100