async/game.lua:30: attempt to index local 'all' (a nil value)
Bastrabun opened this issue · comments
Minetest version
5.6.0-dev latest master 8747215
OS / Hardware
Operating system: debian testing
CPU: AMD Ryzen 5950X
Summary
Error message when starting server
Steps to reproduce
- Build 8747215
- start server
- BOOM
2022-05-06 22:45:24: ERROR[Main]: Execution of async base environment failed: Failed to load and run script from /home/username/projects/minetest/5.6.0-dev/minetest-dev/bin/../builtin/init.lua:
2022-05-06 22:45:24: ERROR[Main]: ...est/5.6.0-dev/minetest-dev/bin/../builtin/async/game.lua:30: attempt to index local 'all' (a nil value)
2022-05-06 22:45:24: ERROR[Main]: stack traceback:
2022-05-06 22:45:24: ERROR[Main]: ...est/5.6.0-dev/minetest-dev/bin/../builtin/async/game.lua:30: in main chunk
2022-05-06 22:45:24: ERROR[Main]: [C]: in function 'dofile'
2022-05-06 22:45:24: ERROR[Main]: .../minetest/5.6.0-dev/minetest-dev/bin/../builtin/init.lua:62: in main chunk
2022-05-06 22:45:24: ERROR[Main]: In thread 7fa7724cca40:
2022-05-06 22:45:24: ERROR[Main]: /home/username/projects/minetest/5.6.0-dev/minetest-master/src/script/cpp_api/s_async.cpp:fd: bool AsyncEngine::prepareEnvironment(lua_State*, int): A fatal error occurred: Execution of async base environment failed
Chiming in to say that I get a similar complete crash on the Android version (armeabi-v7a) of Minetest when built from latest master, whenever launching a world, assumedly also caused by the new async environment. (Although I am not for sure, have not bisected the crash)
Starting the game in next-to-modless singleplayer works. Disabling mods one by one showed that after a certain amount the error appears, but it cannot be fixed to a certain mod.
Is there maybe a size limit to what can be fed to core.deserialize?
Edit: When writing core.transferred_globals to a file, it's about 19MB
core.safe_file_write(minetest.get_worldpath().."/yl_transferred_globals.txt", dump(core.transferred_globals))
"local _ = {}\
_[1] = {[3] = 0.40000000000000002}\
_[2] = {[\"times\"] = _[1], [\"uses\"] = 0, [\"maxlevel\"] = 1}\
_[3] = {3.5, 2, 0.69999999999999996}\
*SNIP*
_[69063] = {-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5}\
_[69064] = {_[69061], _[69062], _[69063]}\
_[69065] = {[\"type\"] = \"fixed\", [\"fixed\"] = _[69064]}\
return {[\"registered_aliases\"] = {[\"unifieddyes:pastel_orange\"] = \"dye:pastel_orange\", [\"moreblocks:junglewood\"] = \"default:junglewood\", [\"farming:desert_sand_soil\"] = \"farming:dry_soil\", [\"homedecor:plastic_sheeting\"] = \"basic_materials:plastic_sheet\", [\"stairs:stair_outer_obsidian_glass\"] = \"moreblocks:stair_obsidian_glass_outer\", [\"vines:ropeladder_falling\"] = \"ropes:ropeladder_falling\",
*SNIP*
[\"sunlight_propagates\"] = true, [\"after_place_node\"] = true, [\"after_dig_node\"] = true, [\"on_timer\"] = true, [\"tubelike\"] = 1, [\"type\"] = \"node\", [\"tube\"] = {[\"connect_sides\"] = {[\"right\"] = 1, [\"left\"] = 1, [\"back\"] = 1, [\"top\"] = 1, [\"front\"] = 1, [\"bottom\"] = 1}, [\"priority\"] = 50, [\"can_go\"] = true}, [\"name\"] = \"pipeworks:lua_tube010001\", [\"_sound_def\"] = {[\"key\"] = \"node_sound_wood_defaults\"}}}}"
Chiming in to say that I get a similar complete crash on the Android version (armeabi-v7a) of Minetest when built from latest master, whenever launching a world, assumedly also caused by the new async environment. (Although I am not for sure, have not bisected the crash)
How do you know it's similar, did you check logcat? Seems likely the resources are outdated. You need to make sure you get the app to update its resources, it won't do this automatically when changing between development versions
I got this crash too. Apparently the deserializer threw this error:
[string "local _ = {}..."]:39737: main function has more than 65536 constants
The solution is probably to make the packer support arbitrary graphs then pack/unpack the globals from C++.
[string "local _ = {}..."]:39737: main function has more than 65536 constants
does this error get swallowed or is it printed anywhere?
I got this crash too. Apparently the deserializer threw this error:
[string "local _ = {}..."]:39737: main function has more than 65536 constants
That's an error thrown by LuaJIT when you attempt to load a single function with too many constants (#7574).
Perhaps an entirely homegrown serializer such as Bluon should be used; JSON has too many limitations to be able to properly represent Lua data.
I had to modify the builtin code to see the error, printing the second return value of core.deserialize
.
I had to modify the builtin code to see the error, printing the second return value of
core.deserialize
.
Consider simply wrapping core.deserialize
in assert
.