D00Med / farlands

Steampunk/fantasy themed subgame with dinosaurs
29 stars 11 forks source link

Crashes #80

Closed tacotexmex closed 6 years ago

tacotexmex commented 7 years ago

I experience random crashes not only of the game but the whole Minetest client as well. This has only happened in Farlands. Is it due to Farlands being developed towards 0.4.16, or perhaps a memory issue?

I'm on a MacBook Pro with 8 GB RAM and Intel HD Graphics 3000 512 MB.

The only error message I get before crash is

[1] 15424 segmentation fault /Applications/minetest.app/Contents/MacOS/minetest

D00Med commented 7 years ago

Are there no other related errors in the debug file?

tacotexmex commented 7 years ago

I ran it again and this time, right before the segfault, it says


2017-04-18 19:09:55: WARNING[Emerge-0]: Assignment to undeclared global "x5" inside a function at ...tion Support/minetest/games/farlands/mods/mines/init.lua:130.
2017-04-18 19:09:55: WARNING[Emerge-0]: Assignment to undeclared global "z5" inside a function at ...tion Support/minetest/games/farlands/mods/mines/init.lua:136.
2017-04-18 19:09:55: ACTION[Emerge-0]: Created mine at (76,-85,129)
tacotexmex commented 7 years ago

Ran it one more time and yes, it seems like it is the mines mod causing trouble:


2017-04-18 19:12:41: WARNING[Emerge-0]: Assignment to undeclared global "x5" inside a function at ...tion Support/minetest/games/farlands/mods/mines/init.lua:166.
2017-04-18 19:12:41: WARNING[Emerge-0]: Assignment to undeclared global "z5" inside a function at ...tion Support/minetest/games/farlands/mods/mines/init.lua:172.
2017-04-18 19:12:41: ACTION[Emerge-0]: Created mine at (130,-112,116)
Desour commented 7 years ago

I made a PR to make these variables local: #81. But that won't be the problem because global variables normally don't cause crashes. @tacotexmex You should add some debug stuff here: https://github.com/D00Med/farlands/blob/master/mods/mines/init.lua#L214 Add after each line something like print("bla0"), print("bla2") (or minetest.log) and co. Then comment here the new error messages.

tacotexmex commented 7 years ago

I'm not that versed in coding and debugging, should I add it after each line within the if cnt == 0 then statement?

Desour commented 7 years ago

@tacotexmex Just edit line 231-216 to something like

        minetest.log("action", "Created mine at ("..mpos.x..","..mpos.y..","..mpos.z..")")
        local out2 = make_mine(p2,p3,mpos,vm_data,vx_area,1)
        minetest.log("action", "bla1")
        local out3 = make_mine(p3,p2,mpos,out2,vx_area,2)
        minetest.log("action", "bla2")
        return out3
tobyplowy commented 6 years ago

Is this fixed already can this be closed?

tacotexmex commented 6 years ago

I need to check with 0.4.16 client

Desour commented 6 years ago

The issue pointed out in this issue is actually not a bug. segmentation fault (in german Speicherzugriffsfehler) is normal and not the fault of farlands.

tobyplowy commented 6 years ago

@DS-Minetest so it's invalid?

tacotexmex commented 6 years ago

I've only had segfault with Farlands, and I've tried a lot of subgames. Let's see if it resolves with .4.16.

tobyplowy commented 6 years ago

@tacotexmex and is it fixed with .4.16.

tacotexmex commented 6 years ago

I still need to test, sorry for stalling.

tobyplowy commented 6 years ago

@tacotexmex is this fixed for you by using the newest version of mt?

tacotexmex commented 6 years ago

Several mines has been created without crashing now that I test with a stable 0.4.16, so it should be safe to say that the bug is now fixed.