Time Nick Message 20:42 MTDiscord another person PM'd me on the forum with that same "not enough memory" when loading biome_lib, as discussed before. He's using 5.4.1, win64 build. 20:42 MTDiscord wtf? 20:44 MTDiscord where are these errors even coming from? the whole mod is only 152 kB or something, and uses less than 1 MB of memory for its tables et al., and it works perfectly for me in singleplayer and on like four of my servers 20:45 MTDiscord is there some kind of LuaJIT- or 64-bit-related bug in the Windows 5.4.1 build? 20:48 sfan5 if that's the error where it barely says anything and just "out of memory" it's coming from C++ and not Lua(JIT) 20:50 MTDiscord well 20:50 MTDiscord it's "not enough memory" 20:50 MTDiscord not "out of memory" 20:50 MTDiscord that's a message thrown by MT (I checked the src), but the question is why? 20:51 MTDiscord I'm wondering if there's something wrong with the package on contentdb maybe? 20:53 MTDiscord hm, doesn't look like it. only 144k unzipped. 20:54 MTDiscord this is the error btw, 2021-04-22 18:36:36: ERROR[Main]: ModError: Failed to load and run script from C:\Users\Tommaso\minetest-5.4.1-win64\bin\..\mods\biome_lib\init.lua: 2021-04-22 18:36:36: ERROR[Main]: not enough memory 20:55 sfan5 thrown by MT where? 20:55 MTDiscord lib/lua/src/lmem.h:#define MEMERRMSG "not enough memory" 20:56 MTDiscord lib/lua/src/ldo.c: setsvalue2s(L, oldtop, luaS_newliteral(L, MEMERRMSG)); lib/lua/src/lstate.c: luaS_fix(luaS_newliteral(L, MEMERRMSG)); lib/lua/src/lmem.h:#define MEMERRMSG "not enough memory" 20:56 MTDiscord those are where the value is actually used 21:00 MTDiscord I have only one theory into this: I've been transitioning the mod away from biome_lib:foo() method-like notation to the more usual biome_lib.bar() (period) notation, and there may be a couple of functions that are still under the old name (but with . instead of :). But those didn't give me any problems, apart from stack overflows in one case (which I already fixed, but which is NOT yet in public use) 21:01 MTDiscord I guess I do need to push a new release to get that engine decoration code into peoples' hands, but I would not expect it to help the two users who reported this "not enough memory" thing. 21:02 MTDiscord (fwiw, the other user is "Big3Force" on the forum) 21:07 sfan5 ok so it seems like it's from Lua 21:07 MTDiscord (new release pushed) 21:07 sfan5 but it's internally out of memory so it can't report anything useful 21:07 sfan5 so mod code causing a stack overflow or similar doesn't sound out of question 21:08 MTDiscord perhaps, but if that were the case, it would explicitly report a stack overflow 21:09 MTDiscord (I mean, it does do that already) 21:22 MTDiscord In any case I pushed the new release to cdb and in Dreambuilder. If there was a stack overflow that isn't being reported properly, there won't be anymore. 21:41 MTDiscord sfan5: could you give c4151a07 a try in 5.4.1-win64, and see how e8afe017 (HEAD) compares? 21:42 MTDiscord the first is where those two users would have been provided they were up-to-date prior to half an hour ago 21:42 sfan5 !mod biome_lib 21:42 MinetestBot sfan5: Biome library [biome_lib] by VanessaE - https://forum.minetest.net/viewtopic.php?t=12999 - https://gitlab.com/VanessaE/biome_lib 21:43 sfan5 what would I install to compare? biome_lib itself doesn't do anything 21:43 MTDiscord eh, moretrees or any one mod in plantlife would be enough 21:44 MTDiscord though I'm not clear on just how much of the latter they were using 21:46 MTDiscord (you can ignore all the warnings biome_lib throws with HEAD, they're harmless) 21:48 sfan5 !mod moretrees 21:48 MinetestBot sfan5: More Trees! [moretrees] by VanessaE - https://forum.minetest.net/viewtopic.php?t=4394 - https://gitlab.com/VanessaE/moretrees 21:51 sfan5 it instantly crashes 21:51 sfan5 2021-04-23 23:51:10: ERROR[Main]: ServerError: AsyncErr: environment_Step: OOM error from mod 'biome_liby 21:51 sfan5 2021-04-23 23:51:10: ERROR[Main]: Current Lua memory usage: 2052 MB 21:51 MTDiscord wow 21:52 MTDiscord and HEAD? 21:52 sfan5 that's HEAD 21:52 MTDiscord wat 21:52 sfan5 the other commit crashes with "ERROR[Main]: not enough memory" 21:53 MTDiscord where the heck is this all coming from? 21:59 sfan5 I've verified it three times now 21:59 sfan5 the faulty commit is https://gitlab.com/VanessaE/biome_lib/-/commit/c4151a0 22:00 MTDiscord wat 22:23 MTDiscord what does os.date() even do on windows then? 22:23 MTDiscord (PiL and lua-users say that it should just work as on POSIX) 22:27 sfan5 you're not gonna believe what it does 22:27 sfan5 https://i.imgur.com/G0SYGbQ.png 22:27 MTDiscord wtf 22:29 sfan5 https://sourceforge.net/p/mingw-w64/bugs/793/ 22:29 sfan5 though luajit shouldn't do this when strftime fails 22:32 MTDiscord so I guess MT needs to provide its own equivalent API call then 22:32 MTDiscord (or intercept os.date()) 22:33 MTDiscord or, is there a way for my mod to detect [windows + luajit] ? 22:36 MTDiscord could I trap this error with assert() 22:39 sfan5 just replace it with os.date("%Y-%m-%d %H:%M:%S") 22:40 MTDiscord ah! so the %F is what breaks it 22:40 MTDiscord I didn't quite understand that mingw link; that explains why the ETA timer at shutdown doesn't crash then 22:40 MTDiscord thanks ? 22:41 sfan5 https://github.com/LuaJIT/LuaJIT/commit/fc63c938b522e147ea728b75f385728bf4a8fc35 22:41 sfan5 turns out luajit has already fixed this 22:41 sfan5 but there's no released version with the fix 22:46 MTDiscord https://gitlab.com/VanessaE/biome_lib/-/commit/4e3493a9812c690052ee319bf94983e95f57f0b6 22:46 MTDiscord pretty sad when the commit msg is longer than the actual code fix ?