Segmentation fault in ReflowScan::scanColumn

User avatar
Imk
Member
 
Posts: 206
Joined: Mon Nov 05, 2018 19:15
Location: Crimea, Russia
In-game: Imk

Segmentation fault in ReflowScan::scanColumn

by Imk » Fri Sep 27, 2019 16:47

version 5.1.0-dev-5fde697-dirty

New builds often give segmentation errors
Code: Select all
2019-09-27 17:59:59: ACTION[Main]: [mana] Wrote mana data into /home/imk/minetest/bin/../worlds/crime8/mana.mt.
./bin/minetestserver.sh: строка 2:  6737 Ошибка сегментирования                   ./bin/minetestserver --gameid minetest --worldname crime8
imk@main:~/minetest$


also in these happens once a day approximately

11.09.2019 version 5.1.0-dev-720aedb-dirty
15.09.2019 5.1.0-dev-23bd563-dirty
19.09.2019 version 5.1.0-dev-c413eeb-dirty

here is another example
Code: Select all
./bin/minetestserver.sh: строка 2:  1563 Ошибка сегментирования                   ./bin/minetestserver --gameid minetest --worldname crime8
imk@main:~/minetest$


file minetestserver.sh
Code: Select all
#!/bin/bash -x
./bin/minetestserver --gameid minetest --worldname crime8
Last edited by Imk on Mon Sep 30, 2019 17:04, edited 2 times in total.
 

User avatar
Krock
Developer
 
Posts: 4391
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: segmentation

by Krock » Fri Sep 27, 2019 16:55

To backtrace the issue, run Minetest in gdb:
Code: Select all
gdb --args /bin/minetestserver --gameid minetest --worldname crime8
.. gdb starts, then enter:
r
.. wait for crash and enter:
bt
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
Imk
Member
 
Posts: 206
Joined: Mon Nov 05, 2018 19:15
Location: Crimea, Russia
In-game: Imk
 

User avatar
Imk
Member
 
Posts: 206
Joined: Mon Nov 05, 2018 19:15
Location: Crimea, Russia
In-game: Imk

Re: segmentation

by Imk » Sun Sep 29, 2019 20:35

surprisingly, he worked for a couple of days without a crash in the gdb.
after the command bt
that's what happened.
Code: Select all
2019-09-29 23:21:34: ACTION[Server]: Kuzya leaves game. List of players:
[Thread 0x7ffff0e86700 (LWP 1112) exited]

Thread 1 "minetestserver" received signal SIGSEGV, Segmentation fault.
0x00000000007b85d2 in ReflowScan::scanColumn(int, int) ()
(gdb) bt
#0  0x00000000007b85d2 in ReflowScan::scanColumn(int, int) ()
#1  0x00000000007ba86a in ReflowScan::scan(MapBlock*, UniqueQueue<irr::core::vector3d<short> >*) ()
#2  0x000000000075c22e in ServerMap::loadBlock(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, irr::core::vector3d<short>, MapSector*, bool) ()
#3  0x00000000007643af in ServerMap::loadBlock(irr::core::vector3d<short>) ()
#4  0x0000000000764826 in ServerMap::emergeBlock(irr::core::vector3d<short>, bool) ()
#5  0x00000000007fcd82 in ServerEnvironment::saveStaticToBlock(irr::core::vector3d<short>, unsigned short, ServerActiveObject*, StaticObject const&, unsigned int) ()
#6  0x00000000007fd95c in std::_Function_handler<bool (ServerActiveObject*, unsigned short), ServerEnvironment::deactivateFarObjects(bool)::{lambda(ServerActiveObject*, unsigned short)#1}>::_M_invoke(std::_Any_data const&, ServerActiveObject*&&, unsigned short&&) ()
#7  0x00000000005f85e5 in server::ActiveObjectMgr::clear(std::function<bool (ServerActiveObject*, unsigned short)> const&) ()
#8  0x00000000007f684c in ServerEnvironment::deactivateFarObjects(bool) ()
#9  0x00000000007f916b in ServerEnvironment::~ServerEnvironment() ()
#10 0x00000000007f97f9 in ServerEnvironment::~ServerEnvironment() ()
#11 0x00000000007e3d24 in Server::~Server() ()

then you just need to get out?
---Type <return> to continue, or q <return> to quit---
 

User avatar
Krock
Developer
 
Posts: 4391
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: segmentation

by Krock » Mon Sep 30, 2019 16:41

Judging from the destructors, this happens when shutting down the server (/shutdown) or similar.

The server tried to save an entity into a newly created mapblocks - this means it's very likely that you have mobs on the server. Builtin items (dropped items) stop on non-existent mapblocks and carts need rails - unless they drive so insanely fast that the position wasn't corrected before saving it to the mapblock.

All this happened while shutting down the server, because the EmergeManager is destructed before ServerEnvironment in https://github.com/minetest/minetest/bl ... #L292-L294.
Whereas "m_ndef" (in scanColumn) still exists in the memory (is Server::getNodeDefManager()), the variable to this pointer (provided by EmergeManager) is already deleted.
You could try to swap the two lines in the link above, re-compile Minetest and check whether it gets worse. Hopefully it doesn't.


EDIT: If you have some time, could you please adjust the title to something more meaningful, such as "Segmentation fault in ReflowScan::scanColumn". Thanks.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
Imk
Member
 
Posts: 206
Joined: Mon Nov 05, 2018 19:15
Location: Crimea, Russia
In-game: Imk

Re: Segmentation fault in ReflowScan::scanColumn

by Imk » Mon Sep 30, 2019 17:20

when shutting down the server (/shutdown) or similar.


No, I started it as soon as you advised, and it's been working for over two days.

I haven't worked with gdb before. Wasn't even installed.
The server tried to save an entity into a newly created mapblocks - this means it's very likely that you have mobs on the server. Builtin items (dropped items) stop on non-existent mapblocks and carts need rails - unless they drive so insanely fast that the position wasn't corrected before saving it to the mapblock.


the mods are set advtrains, carts (minetest_game).

The tb command field I just got out right? Didn't get an answer.
there were options for teams.
---Type <return> to continue, or q <return> to quit---


one more question
you can not exit the debugger and run it again with the command r
or every time you go out there and then go back down
gdb --args ./bin/minetestserver --gameid minetest --worldname crime8

ps I was like a monkey repeating what you said and what to do next, I have no idea)
Last edited by Imk on Mon Sep 30, 2019 18:02, edited 1 time in total.
 

User avatar
Krock
Developer
 
Posts: 4391
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: Segmentation fault in ReflowScan::scanColumn

by Krock » Mon Sep 30, 2019 18:01

Imk wrote:the mods are set advtrains, carts (minetest_game).

Interesting. Must be caused by lag or something in this case.


Imk wrote:The tb command field I just got out right? Didn't get an answer.

Yes, you did everything right. To exit gdb (and Minetest) enter "q" confirm with "y".


Imk wrote:or every time you go out there and then go back down
gdb --args ./bin/minetestserver --gameid minetest --worldname crime8

You should exit the debugger (including Minetest) and start it using that command again. I don't know of a way how to automate this for scripts. However, now that there's a backtrace, you could try to build a modified version of Minetest and check whether it still fails (the same way).
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
Imk
Member
 
Posts: 206
Joined: Mon Nov 05, 2018 19:15
Location: Crimea, Russia
In-game: Imk

Re: Segmentation fault in ReflowScan::scanColumn

by Imk » Mon Sep 30, 2019 18:11

modified version of Minetest

Alas, I don't know how to do that.

the kernel is being updated like this. from the guithab.
Code: Select all
cd minetest; git pull; make -j$(nproc)


every time I think about it, maybe they've already fixed it))
Then he couldn't stand it and wrote this modest report. Suddenly the problem isn't known.
I want to help, but I don't know how.

I will put a new build. start the server in the debugger about the error if it still informs here

version 5.1.0-dev-61e9c1b-dirty test
 

User avatar
Imk
Member
 
Posts: 206
Joined: Mon Nov 05, 2018 19:15
Location: Crimea, Russia
In-game: Imk

Re: Segmentation fault in ReflowScan::scanColumn

by Imk » Mon Sep 30, 2019 19:22

cd minetest; git pull; make -j$(nproc)
what's new, as usual.
version 5.1.0-dev-61e9c1b-dirty
Code: Select all
[ 50%] Building CXX object src/CMakeFiles/minetestserver.dir/mapsector.cpp.o
[ 51%] Building CXX object src/CMakeFiles/minetestserver.dir/nodedef.cpp.o
[ 51%] Building CXX object src/CMakeFiles/minetestserver.dir/nodemetadata.cpp.o
[ 51%] Building CXX object src/CMakeFiles/minetestserver.dir/pathfinder.cpp.o
[ 52%] Building CXX object src/CMakeFiles/minetestserver.dir/player.cpp.o
[ 53%] Building CXX object src/CMakeFiles/minetestserver.dir/reflowscan.cpp.o
[ 53%] Building CXX object src/CMakeFiles/minetestserver.dir/remoteplayer.cpp.o
In file included from /usr/include/irrlicht/irrString.h:9:0,
                 from /usr/include/irrlicht/matrix4.h:14,
                 from /home/imk/minetest/src/util/numeric.h:27,
                 from /home/imk/minetest/src/content_sao.h:23,
                 from /home/imk/minetest/src/remoteplayer.cpp:23:
/usr/include/irrlicht/irrAllocator.h: In destructor ‘irr::core::irrAllocator<T>::~irrAllocator() [with T = char]’:
/usr/include/irrlicht/irrAllocator.h:30:27: internal compiler error: Ошибка сегментирования
  virtual ~irrAllocator() {}
                           ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
src/CMakeFiles/minetestserver.dir/build.make:4286: ошибка выполнения рецепта для цели «src/CMakeFiles/minetestserver.dir/remoteplayer.cpp.o»
make[2]: *** [src/CMakeFiles/minetestserver.dir/remoteplayer.cpp.o] Ошибка 1
CMakeFiles/Makefile2:280: ошибка выполнения рецепта для цели «src/CMakeFiles/minetestserver.dir/all»
make[1]: *** [src/CMakeFiles/minetestserver.dir/all] Ошибка 2
Makefile:149: ошибка выполнения рецепта для цели «all»
make: *** [all] Ошибка 2

successful restart
Code: Select all
Already up-to-date.
[  0%] Built target jsoncpp
[ 14%] Built target lua
-- *** Detected Git version 5.1.0-dev-61e9c1b-dirty ***
[ 14%] Built target GenerateVersion
[ 14%] Building CXX object src/CMakeFiles/minetestserver.dir/remoteplayer.cpp.o
[ 14%] Building CXX object src/CMakeFiles/minetestserver.dir/rollback.cpp.o
[ 15%] Building CXX object src/CMakeFiles/minetestserver.dir/rollback_interface.cpp.o
[ 16%] Building CXX object src/CMakeFiles/minetestserver.dir/server.cpp.o
[ 16%] Building CXX object src/CMakeFiles/minetestserver.dir/serverenvironment.cpp.o
[ 16%] Building CXX object src/CMakeFiles/minetestserver.dir/serverobject.cpp.o
[ 16%] Building CXX object src/CMakeFiles/minetestserver.dir/staticobject.cpp.o
[ 16%] Building CXX object src/CMakeFiles/minetestserver.dir/tool.cpp.o
[ 16%] Building CXX object src/CMakeFiles/minetestserver.dir/version.cpp.o
[ 17%] Building CXX object src/CMakeFiles/minetestserver.dir/voxel.cpp.o
[ 17%] Building CXX object src/CMakeFiles/minetestserver.dir/voxelalgorithms.cpp.o
[ 18%] Linking CXX executable ../bin/minetestserver
[100%] Built target minetestserver
 

User avatar
Imk
Member
 
Posts: 206
Joined: Mon Nov 05, 2018 19:15
Location: Crimea, Russia
In-game: Imk

Re: Segmentation fault in ReflowScan::scanColumn

by Imk » Tue Oct 01, 2019 16:06

gdb
worked 24 hours a day.
version 5.1.0-dev-61e9c1b-dirty
Code: Select all
Thread 4 "Server" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff0e86700 (LWP 4829)]
0x00000000007eac6f in Server::AsyncRunStep(bool) ()
(gdb) bt
#0  0x00000000007eac6f in Server::AsyncRunStep(bool) ()
#1  0x00000000007ed0fe in ServerThread::run() ()
#2  0x00000000005fc4f1 in Thread::threadProc(Thread*) ()
#3  0x00007ffff6b08c80 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff724a6ba in start_thread (arg=0x7ffff0e86700)
    at pthread_create.c:333
#5  0x00007ffff626e41d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
 

User avatar
Imk
Member
 
Posts: 206
Joined: Mon Nov 05, 2018 19:15
Location: Crimea, Russia
In-game: Imk

Re: Segmentation fault in ReflowScan::scanColumn

by Imk » Wed Oct 02, 2019 18:54

21:52
version 5.1.0-dev-61e9c1b-dirty
Code: Select all
Temporary breakpoint 1 at 0x57dca1
(gdb) bt
#0  0x000000000057dca1 in read_v3d(lua_State*, int) ()
#1  0x0000000000000000 in ?? ()
(gdb)







 

User avatar
Imk
Member
 
Posts: 206
Joined: Mon Nov 05, 2018 19:15
Location: Crimea, Russia
In-game: Imk

Re: Segmentation fault in ReflowScan::scanColumn

by Imk » Thu Oct 03, 2019 14:08

2019-10-03 16:29:04
version 5.1.0-dev-61e9c1b-dirty
Code: Select all
2019-10-03 16:29:04: ACTION[Server]: [playereffects] Wrote playereffects data into /home/imk/minetest/bin/../worlds/crime8/playereffects.mt.

Thread 4 "Server" received signal SIGILL, Illegal instruction.
[Switching to Thread 0x7ffff0e86700 (LWP 11142)]
0x000000000070999c in gob_cmd_update_position[abi:cxx11](irr::core::vector3d<float>, irr::core::vector3d<float>, irr::core::vector3d<float>, irr::core::vector3d<float>, bool, bool, float) ()
(gdb) bt
#0  0x000000000070999c in gob_cmd_update_position[abi:cxx11](irr::core::vector3d<float>, irr::core::vector3d<float>, irr::core::vector3d<float>, irr::core::vector3d<float>, bool, bool, float) ()
#1  0x00000000006c9ace in LuaEntitySAO::sendPosition(bool, bool) ()
#2  0x00000000006cb08b in LuaEntitySAO::step(float, bool) ()
#3  0x00000000007f4507 in std::_Function_handler<void (ServerActiveObject*), ServerEnvironment::step(float)::{lambda(ServerActiveObject*)#1}>::_M_invoke(std::_Any_data const&, ServerActiveObject*&&) ()
#4  0x00000000005f80fb in server::ActiveObjectMgr::step(float, std::function<void (ServerActiveObject*)> const&) ()
#5  0x0000000000803aa8 in ServerEnvironment::step(float) ()
#6  0x00000000007ea968 in Server::AsyncRunStep(bool) ()
#7  0x00000000007ed0fe in ServerThread::run() ()
#8  0x00000000005fc4f1 in Thread::threadProc(Thread*) ()
#9  0x00007ffff6b08c80 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00007ffff724a6ba in start_thread (arg=0x7ffff0e86700) at pthread_create.c:333
#11 0x00007ffff626e41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb)
 


Return to Problems



Who is online

Users browsing this forum: No registered users and 4 guests