MinetestForFun / server-minetestforfun

Repository of the subgame and mods of "MinetestForFun" server
https://www.xorhub.com
The Unlicense
27 stars 10 forks source link

[Nether] mod crash server ? #36

Closed BetterToAutomateTheWorld closed 9 years ago

BetterToAutomateTheWorld commented 9 years ago

Logs : http://zerobin.qbuissondebon.info/?9fb5d60e93824a62#QEe1RFluZuOZZhvvkyJgpi2xWlsHQJl2/wnA3fDQrpY=

After testimony, il would seem the server crash when a player generate new maps parts/chunks in the nether world.

BetterToAutomateTheWorld commented 9 years ago

More logs : http://zerobin.qbuissondebon.info/?ab69bce6919a3ea2#V6pIPu85EOjoNfYG2OB0Jd3SinKzm952jW9gqlMOfiY=

Lymkwi commented 9 years ago

And there we go : [ https://github.com/Ombridride/minetest-minetestforfun-server/commit/4ffd2edfa571f59d0979ed519013345658d630f5 ]

ghost commented 9 years ago

crash fixed display var to debug /mods/nether/nether/init.lua line 360 side_length always 78 --> crash

crash [nether] generates at: x=[-272; -193]; y=[-19952; -19873]; z=[-912; -833] maxp.x:-193 minp.x: -272 side_length: 78 /mods/nether/nether/init.lua:389: attempt to perform arithmetic on a nil value /mods/nether/nether/init.lua:396: bad argument #1 to 'abs' (number expected, got nil)

ok [nether] generates at: x=[-352; -273]; y=[-20032; -19953]; z=[-992; -913] maxp.x:-273 minp.x: -352 side_length: 80 [nether] nodes set after ca. 0.84s

Lymkwi commented 9 years ago

What is exactly the side_length and why does it crash at 78?

ghost commented 9 years ago

ok I found nether/nether/init.lua line 360 maxp.x - minp.x = 79 side_length = maxp.x - minp.x - 1 --> (78)

map_lengths_xyz = {x=side_length, y=side_length, z=side_length} --> 78X78 = 6084 pmap1 = minetest.get_perlin_map(perlins[1], map_lengths_xyz):get2dMap_flat(minp) --> pmap1[6084]

line384 for x=minp.x, maxp.x do -> 79 --> 79x79 = 6241 count = count+1 --> when 6085, pmap1[count] = nil crash

better fix ? for x=minp.x, maxp.x do count = count+1 if count > side_length then return end

Lymkwi commented 9 years ago

The nether doesn't crash the server anymore, however @Ombridride will have to do a /deleteblocks on a quite big part of the nether to generate it again.

BetterToAutomateTheWorld commented 9 years ago

I will delete this issue ticket when the /deletblocks will be done

Lymkwi commented 9 years ago

About the deleteblocks, it would be good to do it fast. @crabman77 and I noticed that the version of minetestserver introduced tons of bugs both in the program itself (segfaults, memory corruption attemps,etc) and in the network (malformed or missing packets, client freezing while loading things like HUD). From yesterday's HEAD, minetest is completly unstable, and it should be downgraded to 0.4.12-realease (which is very stable in comparison). Server was running 0.4.11-dev before if I remember correctly, so it shouldn't be a big problem. (because it's still an update)

BetterToAutomateTheWorld commented 9 years ago

Can't close for the moment the issue, because i can't /deleteblocks without crashing the server...

BetterToAutomateTheWorld commented 9 years ago

The command i need to use is /deleteblocks (40 -20040 -685) (290 -19950 -496)

But i need to wait 0.4.13-Release Minetest

BetterToAutomateTheWorld commented 9 years ago

Resolved because we changed our mapgen