I found a crashingly bad error.

Post Reply
User avatar
benrob0329
Member
Posts: 1321
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

I found a crashingly bad error.

by benrob0329 » Post

After about 30 seconds every time I restart my personal MT server running Ubuntu I get this and a crash:

Code: Select all

minetest: /build/minetest-xOOHPg/minetest-0.4.13/src/util/serialize.h:265: void writeF1000(irr::u8*, irr::f32): Assertion `i >= ((float)(s32)((-0x7FFFFFFF - 1) / 1000.0f)) && i <= ((float)(s32)((0x7FFFFFFF) / 1000.0f))' failed.
Aborted (core dumped)
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA

User avatar
TenPlus1
Member
Posts: 2776
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: I found a crashingly bad error.

by TenPlus1 » Post

Yeah, we get that a lot in Xanadu for no aparent reason...

User avatar
benrob0329
Member
Posts: 1321
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Re: I found a crashingly bad error.

by benrob0329 » Post

Is the Xanadu server running Ubuntu?
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA

User avatar
TenPlus1
Member
Posts: 2776
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: I found a crashingly bad error.

by TenPlus1 » Post

Xanadu server is running 64-bit Lubuntu 14.04 LTS...

User avatar
Hybrid Dog
Member
Posts: 2752
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: I found a crashingly bad error.

by Hybrid Dog » Post

TenPlus1 wrote:Xanadu server is running 64-bit Lubuntu 14.04 LTS...
l'm using 32-bit Lubuntu 14.04 LTS and get the error in singleplayer game, irrlicht 1.8.1

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: I found a crashingly bad error.

by 4aiman » Post

Actually, there is an explanation for this and it is quite easy to "hide".

Lines 263-267 of serialize.h:

Code: Select all

inline void writeF1000(u8 *data, f32 i)
{
	assert(i >= F1000_MIN && i <= F1000_MAX);
	writeS32(data, i * FIXEDPOINT_FACTOR);
}
The assert above crashes the game.
But I see no reason for using "assert" because of the lines 35-43 of serialize.h:
// 0x7FFFFFFF / 1000.0f is not serializable.
// The limited float precision at this magnitude may cause the result to round
// to a greater value than can be represented by a 32 bit integer when increased
// by a factor of FIXEDPOINT_FACTOR. As a result, [F1000_MIN..F1000_MAX] does
// not represent the full range, but rather the largest safe range, of values on
// all supported architectures.
Note: This definition makes assumptions on
// platform float-to-int conversion behavior.
#define F1000_MIN ((float)(s32)((-0x7FFFFFFF - 1) / FIXEDPOINT_FACTOR))
#define F1000_MAX ((float)(s32)((0x7FFFFFFF) / FIXEDPOINT_FACTOR))
So, the game *knows* there may be values outside the range, but uses assert instead of a simple check nevertheless.
That results in a crash instead of error/warning.


Thus, the first step would be to change the code above to throw warning/error instead of asserting the range.
The second step would be to ensure that there's no numbers smaller than F1000_MIN or bigger that F1000_MAX in your Lua code.


BTW, that assertion is something that was added quite recently (a month or so) as Magichet does not contain that check and I've seen no consequences yet.

(I hope, me mentioning MCG won't be treated as the ads of sorts yet another time. My intentions are pure "comparative" and "bug-tracking").

User avatar
rubenwardy
Moderator
Posts: 6156
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: I found a crashingly bad error.

by rubenwardy » Post

assertions should be used to check for coding mistakes. An assertion means that this condition should always be true, if it's not then there's a problem with the code.

There is, of course, value in crashing gracefully or recovering and resuming - but it's probably a bad idea in this case. (as the packet may not be serialised correctly, or it may drop, resulting in loss of data / bad things.)

Does anyone have any tracebacks of this issue?

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: I found a crashingly bad error.

by 4aiman » Post

I know what assertions are.
My personal opinion is that assertions are somewhat of a "debug" nature which should not be in release builds.
Throwing error would do the same job here.
The question is, whether a packet loss from one client should crash the whole server and ruin the experience of many others or not.


Anyway, TenPlus1 would be able to produce some tracebacks, I think.

User avatar
Hybrid Dog
Member
Posts: 2752
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: I found a crashingly bad error.

by Hybrid Dog » Post

Does that assertion cause a crash if players try to teleport extremely far away?

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
TenPlus1
Member
Posts: 2776
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: I found a crashingly bad error.

by TenPlus1 » Post

I ran a standalone server for quite some time and the only thing that brought up the serialize.h error was to teleport the player far outside normal map limits, which led me to believe the updatelistener but that causes player to fall through world may be to blame on linux servers causing the initial crashing...

zzantozz
Member
Posts: 31
Joined: Sun Sep 06, 2015 23:54

Re: I found a crashingly bad error.

by zzantozz » Post

I'm getting this same crash. Is changing the code the only accepted workaround? I'd rather not have to jump all the way to building this from source right now. I only started running a server for my kids to play on a few weeks ago. I have a saved world that recreates the crash immediately due to, I think, fire damage from a mob if anyone wants it.

zzantozz
Member
Posts: 31
Joined: Sun Sep 06, 2015 23:54

Re: I found a crashingly bad error.

by zzantozz » Post

It seems my issue is related to a mob. One client saw what I think is a mobs:mese_monster fly up into the air right when the server crashed. I restarted it multiple times with the same result every time. I disabled the mobs mod, and everything is working again. As TenPlus1 mentioned in viewtopic.php?f=6&t=13194, a simple teleport will crash it, too.

User avatar
TenPlus1
Member
Posts: 2776
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: I found a crashingly bad error.

by TenPlus1 » Post

Have checked dungeon master and that works ok, will do more tests on the other mobs to make sure it's not the problem...

Note: make sure you are using the latest Mobs Redo release...

Update: All checks made but I couldn't make MT 0.4.13 crash by placing mobs in our out of water, but... I have added map limit checks to the mob api just to make sure...

zzantozz
Member
Posts: 31
Joined: Sun Sep 06, 2015 23:54

Re: I found a crashingly bad error.

by zzantozz » Post

TenPlus1 wrote:Have checked dungeon master and that works ok, will do more tests on the other mobs to make sure it's not the problem...

Note: make sure you are using the latest Mobs Redo release...

Update: All checks made but I couldn't make MT 0.4.13 crash by placing mobs in our out of water, but... I have added map limit checks to the mob api just to make sure...
Well, I'm using the one linked at the bottom of the Mobs Redo post labelled 1.16. I could try hopping over to github and getting the latest master.

Otoh, with virtually zero knowledge about what I'm doing, I went into the Mobs Redo init.lua and commented out the mese_monster line, and it hasn't crashed again, despite several hours of playing. It could still be a coincidence.

User avatar
TenPlus1
Member
Posts: 2776
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: I found a crashingly bad error.

by TenPlus1 » Post

zzantozz, would you mind telling me what other mods you have running alongside Mobs Redo and if any, what [game] you are running ?!?!

zzantozz
Member
Posts: 31
Joined: Sun Sep 06, 2015 23:54

Re: I found a crashingly bad error.

by zzantozz » Post

TenPlus1 wrote:zzantozz, would you mind telling me what other mods you have running alongside Mobs Redo and if any, what [game] you are running ?!?!
Sure thing. I'm a relative newb to minetest, so let me know if there's a better way to do this. All of these things have been downloaded in the last 2-3 weeks, so it should all be relatively up-to-date. Here's the listing of mods I've installed on the server:

Code: Select all

$ ls .minetest/mods/
3d_armor  bees_candles  castles       farming            industrial      moreores           protector          vines
ambience  biome_lib     craft_guide   farming_plus       inventory_plus  moretrees          technic
beds      carts         craftingpack  gems               mobs            pipeworks          throwing
bees      castle        ethereal      homedecor_modpack  moreblocks      plantlife_modpack  unified_inventory
Here are the enabled ones:

Code: Select all

$ grep true .minetest/worlds/server/world.mt 
load_mod_bees_candles = true
load_mod_beds = true
load_mod_carts = true
load_mod_farming_plus = true
load_mod_gems = true
load_mod_industrial = true
load_mod_mobs = true
load_mod_moreores = true
load_mod_throwing = true
load_mod_3d_armor = true
load_mod_craft_guide = true
load_mod_crafting = true
load_mod_inventory_plus = true
And here's the entire worlds.mt for the server:

Code: Select all

$ cat .minetest/worlds/server/world.mt 
gameid = minetest
backend = sqlite3
load_mod_ambience = false
load_mod_bees_candles = true
load_mod_beds = true
load_mod_carts = true
load_mod_farming_plus = true
load_mod_gems = true
load_mod_industrial = true
load_mod_mobs = true
load_mod_moreores = true
load_mod_throwing = true
load_mod_3d_armor = true
load_mod_building_blocks = false
load_mod_castle = false
load_mod_chains = false
load_mod_computer = false
load_mod_craft_guide = true
load_mod_crafting = true
load_mod_creative = false
load_mod_ethereal = false
load_mod_fake_fire = false
load_mod_farming = false
load_mod_homedecor = false
load_mod_homedecor_3d_extras = false
load_mod_inbox = false
load_mod_inventory_plus = true
load_mod_itemframes = false
load_mod_lavalamp = false
load_mod_lrfurn = false
load_mod_plasmascreen = false
load_mod_protector = false
load_mod_shields = false
load_mod_signs_lib = false
load_mod_technic_armor = false
load_mod_unified_inventory = false
load_mod_wieldview = false
load_mod_3dmushrooms = false
load_mod_along_shore = false
load_mod_bees = false
load_mod_biome_lib = false
load_mod_bushes = false
load_mod_bushes_classic = false
load_mod_castles = false
load_mod_cavestuff = false
load_mod_concrete = false
load_mod_dryplants = false
load_mod_extranodes = false
load_mod_ferns = false
load_mod_flowers_plus = false
load_mod_junglegrass = false
load_mod_molehills = false
load_mod_moreblocks = false
load_mod_moretrees = false
load_mod_nature_classic = false
load_mod_pipeworks = false
load_mod_poisonivy = false
load_mod_technic = false
load_mod_technic_chests = false
load_mod_technic_worldgen = false
load_mod_trunks = false
load_mod_vines = false
load_mod_woodsoils = false
load_mod_wrench = false
load_mod_youngtrees = false
And for completeness, the server config:

Code: Select all

$ cat .minetest/minetest-server.conf 
enable_shaders = true
maintab_LAST = multiplayer
menu_last_game = minetest
port = 30000
server_dedicated = true
map-dir = /home/ryan/.minetest/worlds/server
unlimited_player_transfer_distance = false
player_transfer_distance = 3
enable_damage = true
enable_pvp = false
I'm sure there are a couple of settings in that config that don't belong, like shaders. It's my first attempt from when I was figuring out how to set up a headless server.

zzantozz
Member
Posts: 31
Joined: Sun Sep 06, 2015 23:54

Re: I found a crashingly bad error.

by zzantozz » Post

Also, I don't recall if I mentioned before, but I have a world archived where the bug was completely repeatable for me. It also just dawned on me that a similar phenomenon (shooting skyward) happened to one of the players the other day. I don't know what she was doing when it happened, but suddenly she had some pretty strong upward velocity that just kept going until she logged out of the server and back in. On returning, she appeared up in the air and plummeted groundward, where she splatted.

User avatar
TenPlus1
Member
Posts: 2776
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: I found a crashingly bad error.

by TenPlus1 » Post

It sounds like the updatelistener bug where the player can fall through the world which can cause the crash and end up with player restarting game at a random position... Your mods are ok, none should clash with mobs mod at all, but I still cannot reproduce the glitch using mobs itself... How big is your archived map file with the glitch in it ?

zzantozz
Member
Posts: 31
Joined: Sun Sep 06, 2015 23:54

Re: I found a crashingly bad error.

by zzantozz » Post

TenPlus1 wrote:How big is your archived map file with the glitch in it ?
About 83M. I can't think of anything offhand I could use to get that to you, but I'll come up with something unless you have a way.

zzantozz
Member
Posts: 31
Joined: Sun Sep 06, 2015 23:54

Re: I found a crashingly bad error.

by zzantozz » Post

Commenting out the mese_monster from the init apparently didn't didn't fix it. It crashed again several times in a row a little while ago. I uncommented the line again to see if it helps since there's the "not defined" error:

Code: Select all

2015-09-08 17:12:21: ERROR[ServerThread]: LuaEntity name "mobs:mese_monster" not defined
minetest: /build/minetest-xOOHPg/minetest-0.4.13/src/util/serialize.h:265: void writeF1000(irr::u8*, irr::f32): Assertion `i >= ((float)(s32)((-0x7FFFFFFF - 1) / 1000.0f)) && i <= ((float)(s32)((0x7FFFFFFF) / 1000.0f))' failed.

zzantozz
Member
Posts: 31
Joined: Sun Sep 06, 2015 23:54

Re: I found a crashingly bad error.

by zzantozz » Post

I've added all the mods and config file to the archive, taking the size up to 102M. I poked a hole in my firewall to a temp web server where you can download it. Let me know when you've got it so I can close up the firewall again. With that archive, I can follow the steps below and get the crash in about 10 seconds. Just start it as shown, and do nothing. You'll be sinking into the water, and it'll crash shortly after you spawn. If you fiddle with it some, you might see a mese monster in the water ahead of you, and the crash may or may not happen.

Code: Select all

cd ~
mv .minetest .minetest-real
mkdir .minetest
cd .minetest
wget http://70.123.240.185/backup-worlds-crash-20150907.tar.gz
wget http://70.123.240.185/backup-worlds-crash-20150907.tar.gz.sha1
sha1sum -c backup-worlds-crash-20150907.tar.gz.sha1
tar xf backup-worlds-crash-20150907.tar.gz
minetest --config minetest-server.conf --name owen --go
In case you don't have wget available, you can download the archive here. (sha1sum df055ffda15f78149b3936d6641c6ff21fc5a16b)

This is all with:

Code: Select all

$ minetest --version
Minetest 0.4.13
Using Irrlicht 1.8.1
Build info: VER=0.4.13 BUILD_TYPE=None RUN_IN_PLACE=0 USE_GETTEXT=1 USE_SOUND=1 USE_CURL=1 USE_FREETYPE=1 USE_LUAJIT=1 STATIC_SHAREDIR="/usr/share/minetest"

User avatar
TenPlus1
Member
Posts: 2776
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: I found a crashingly bad error.

by TenPlus1 » Post

zzantozz, thank you got the download, I have it unpacked on my system and am about to test it now :)

User avatar
TenPlus1
Member
Posts: 2776
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: I found a crashingly bad error.

by TenPlus1 » Post

Wow, so many error messages appear when running this world... Firstly, did you run an older mobs mod before switching to Mobs Redo ? as many of the errors seem to be missing textures for mobs that don't exist in my mod... secondly, the beehive and candle mod has a deprecated command that floods the terminal with errors when close to a hive... I would recommend using X-Decor as it has a working beehive included that does the same...

Finally, the world did not crash at all, and I ran it a few times then unpacked the original map again and ran that a few times just to make sure... Only the above errors appear... also you are using an old Mobs Redo here (last months), here's the link for the new one: https://github.com/tenplus1/mobs/archive/master.zip

zzantozz
Member
Posts: 31
Joined: Sun Sep 06, 2015 23:54

Re: I found a crashingly bad error.

by zzantozz » Post

TenPlus1 wrote:Wow, so many error messages appear when running this world... Firstly, did you run an older mobs mod before switching to Mobs Redo ? as many of the errors seem to be missing textures for mobs that don't exist in my mod...
Yes, I did try another mobs mod before I found yours. I've seen those errors but couldn't figure out where they were coming from. Will they cause problems in the world?
TenPlus1 wrote:secondly, the beehive and candle mod has a deprecated command that floods the terminal with errors when close to a hive... I would recommend using X-Decor as it has a working beehive included that does the same...
Yes, I found and fixed that. Sorry I sent you an unfixed version. The mod's init.lua uses variables that were deprecated between 0.4.11 and 0.4.13. I let the owner of that mod know.
TenPlus1 wrote:Finally, the world did not crash at all, and I ran it a few times then unpacked the original map again and ran that a few times just to make sure... Only the above errors appear... also you are using an old Mobs Redo here (last months), here's the link for the new one: https://github.com/tenplus1/mobs/archive/master.zip
:\ :\ Well, I don't know what "unpacked the original map" means, but thanks so much for taking the time to check it out. I'll try out the new mod version to see if that helps. If this is a dead end, then any other ideas what I could do about this crash, which is still happening annoyingly often?

Code: Select all

minetest: /build/minetest-xOOHPg/minetest-0.4.13/src/util/serialize.h:265: void writeF1000(irr::u8*, irr::f32): Assertion `i >= ((float)(s32)((-0x7FF
FFFFF - 1) / 1000.0f)) && i <= ((float)(s32)((0x7FFFFFFF) / 1000.0f))' failed.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest