Memory overflow issues #24
Labels
bug
Something isn't working
critical
Critical bug that needs fixing ASAP
good first issue
Good for newcomers
help wanted
Extra attention is needed
There are three main issues in EdiZon right now, possibly all caused by the same problem: The available RAM's overflowing.
First of all, EdiZon crashes when returning back to the hbmenu using the + button. This will cause a 2168-0001 (Userland ARM prefetch-abort due to PC set to non-executable region)This issue was caused by deleting the current GUI object in the input thread without the use of a mutex. Input thread deletes GUI -> main thread is executing code in freed memory -> prefetch abort
Sadly the switch is still crashing when exiting. This time though the crash causes a 2168-0002 (Segfault). Most likely caused by freeing an already deleted array somewhere in the destructor of a static object.Additionally, the switch only crashes when pressing the PLUS button, if you're not editing a game. It crashes in the GuiMain and the GuiEditor when not editing.
The error was caused by calling
lua_close
in the destructor of ScriptParser. I had a global instance of ScriptParser in GuiEditor (which REALLY should be a member variable) which got deleted, when closing the program, therefore calling the destructor and lua_close with a nullptr as lua context. This, of course, caused a Segfault.Second, loading lua modules inside scripts causes a 2168-0002 (Segfault) in some cases. Needs further investigation. For example, Octopath works but Hollow Knight doesn't.This issue was introduced in commit $1ebb351 and is probably caused by EdiZon accessing the luaState from the input thread while it was initially created by the main thread.
The last issue is probably caught by Lua, therefore not causing a segfault. When loading huge save files as string into a Lua script, Lua will replace the entire string withnot enough memory
.I think the issue lies somewhere in the EdiZon code being wasteful on resources or having serve memory leaks.
This last issue was actually a bug in Lua version 5.3.4 and should have been fixed by updating the Lua runtime to 5.3.5. Needs further testing/confirmation though
If anybody has time and wants to check the code for issues like this, you're very welcome to do so!
The text was updated successfully, but these errors were encountered: