Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Seeking volounters, test bug in Minetest for Mineclonia mob
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
kgdrenefort
Guru
Guru


Joined: 19 Sep 2023
Posts: 314
Location: Somewhere in the 77

PostPosted: Wed May 22, 2024 4:20 pm    Post subject: Seeking volounters, test bug in Minetest for Mineclonia mob Reply with quote

Hello,

I have come across server crash for minetestserver (5.8.0), using mineclonia mod.

The problem:

Very often, while hitting any mobs or animal added by this mod, the server crash. Sometimes it was not, but mostly, it was a plain crash.

After opening a bug here : https://codeberg.org/mineclonia/mineclonia/issues/1444

Turns out the problem is confirmed in this circumstance: Using a compiled version of the game without using luajit to compile it with their current code, which has a bug (and a fix, now). In my case, lua5.1.

But once you compile it with luajit, without changing any codes, it works as it should be.

Also, the fix they added removes completely any needs for using luajit, the bug has been fixed since my report, which is nice. It does not crash any more after my test.

The need:

I would like this bug to be reproduced on other system. It's pretty much easy. Specially since Gentoo's default use flag don't use luajit, so this bugs would have been avoided anyway if I was using luajit.

Reproducing the bug as me.

Reproducing the bug, as reporting the results:

I. First, vanilla compilation without the bug fix

1/ Install minetest with, possibly, the server flag. But I really think it'll happen nonetheless if you just host your own game from the client. Be sure it does use lua5.1, not luajit (this is important):

Code:
minetest --version


Should return you lua version, as 5.1, not luajit.

2/ Install from here the codeberg's code : https://codeberg.org/mineclonia/mineclonia
a) Go into the .minetest directory of the user that will run the game.
Code:
mkdir ~/.minetest/games && cd ~/.minetest/games && git clone https://codeberg.org/mineclonia/mineclonia


3) Check if you use the buggy version of the code:
a)
Code:
cd ~/.minetest/games/mineclonia

b)
Code:
git checkout fix_criticals_crash

(it should answer there is no such file ! If it does reply an error, you are not running the non-patched version to fix that bug, which is needed here !)

c) If b is good:
Code:
git checkout main

(should answer you are using this branch)

4) Run the game from command line (to get the output when it crashes), possibly a server aside, or host your own, with the game mode mineclonia. No other mods.

5) Hit anything that is moving, with hands or sword or axe, no cares, only in melee tho.

6) If it crash, report it as well these informations:
a)
Code:
minetest --version

It'll also show which lua was used, 5.1 or luajit. It has to be 5.1 !

b) Show us the use flag used to compile minetest as well, still neat.

c) The crash's output, complaining about lua.

d) Anything you might find relevant.

Good !

II. Applying the patch to verify, without luajit, if it does not crash anymore, if it was.

Now before recompiling minetest using luajit, backup your ~/.minetest directory and download the fix as well:

Code:
cp -a ~/.minetest ~/.minetest_unpatched

Code:
cd ~/.minetest/games/mineclonia

Code:
git fetch -u origin fix_criticals_crash:fix_criticals_crash

Code:
git checkout fix_criticals_crash


Now that the patch is applied. Reproduce the bug as above, report as well if it crash or not.

III. Removing the patch, compiling minetest with luajit and avoiding the crash.

Now, please, add this to your packages.use for minetest:

Code:
LUA_SINGLE_TARGET: -* luajit


Recompile minetest.

Be sure to have this output concerning lua before anything please:

Code:
Minetest 5.8.0 (Linux)
Using Irrlicht 1.9.0mt13
Using LuaJIT 2.1.0-beta3
BUILD_TYPE=Release
RUN_IN_PLACE=0
USE_CURL=1
USE_GETTEXT=1
USE_SOUND=1
STATIC_SHAREDIR="/usr/share/minetest"
STATIC_LOCALEDIR="/usr/share/minetest/locale"


Using LuaJit.

It will remove any luaX.X and let luajit pre-compile the lua code, which is… a way to avoid the bug.

Revert the backup:

Code:
rm -rf ~/.minetest && cp -a ~/.minetest_unpatched ~/.minetest


Try to reproduce the bug, and repeat the process to bring information here.

It should not crash either with luajit and the non-fixed code.

IV. Final goal

I'll myself report (or link this topic) to the developers of mineclonia. Some math were incorrect, leading to this crash. Even if luajit is fixing it, it's better to solve it for good, don't you think ? 

Also, depending, would recommend or discuss with the maintainers of minetest of Gentoo if it would be nice to add luajit as default, since it seems it could prevent some bugs ? I'm not an expert, but the suggestion would be bringed.

Also, I think that is something worth being added in the wiki, which I am ready to, but would like to have confirmed reproduction of the behaviour if not using luajit. It could help peoples in the future to avoid crash or other bugs, maybe. Still neat to know.

Thanks for you time to help improving this game and this popular mods.

Regards,
GASPARD DE RENEFORT Kévin
_________________
Traduction wiki, pour praticiper.
Custom logos/biz card/website.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum