love
love copied to clipboard
"Failed to initialize filesystem: already initialized" error triggering when a stack overflow occurs
It seems that it only happens under certain conditions because sometimes the stack overflow error is properly displayed, I did some tests but didn't find any clues...
Here's the error message:
Error: [love "boot.lua"]:48: Failed to initialize filesystem: already initialized
stack traceback:
[C]: in function 'init'
[love "boot.lua"]:48: in function <[love "boot.lua"]:42>
[C]: in function 'xpcall'
[love "boot.lua"]:350: in function <[love "boot.lua"]:348>
[C]: in function 'xpcall'
I'm on Windows 10
Are you doing anything funny with the errorhandler? I had a similar sounding issue, and it was to do with my modified errorhandler
No, I did a full search through all files in my project and not even the libraries are touching the errorhandler
A few people have run into this issue before I think - if anyone has some code that can reproduce it, it'd help a lot with fixing it.
Thanks to @zombrodo I am able to reproduce it about half the time with this code:
function love.load()
local function x(b)
if true then
local a = 2 * b
x(a)
end
end
x(1)
end
If I turn JIT compilation off by adding jit.off() to the top of the file, it goes away (the normal stack overflow error appears). I suspect it's a combination of this https://github.com/LuaJIT/LuaJIT/issues/618#issuecomment-697004047 as well as the way earlyinit and this loop handles things here (it ends up calling love.boot twice in the situations where the already initialized error happens): https://github.com/love2d/love/blob/main/src/modules/love/boot.lua#L369-L373
I'll have to investigate that earlyinit function a bit to make sure I don't accidentally mess anything up if I change it.
A recent LuaJIT commit appears to fix this for me (probably https://github.com/LuaJIT/LuaJIT/commit/8135de2a0204e6acd92b231131c4a1e0be03ac1c). I'll close this issue once we update megasource's version.
LuaJIT has been updated. love2d/megasource@1025e7b6e08b346823f88f0cad6d68c0804a9975.