• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ gdb error - server crashing

Mjmackan

Mapper ~ Writer
Premium User
Joined
Jul 18, 2009
Messages
1,424
Solutions
15
Reaction score
177
Location
Sweden
Hey i got this error when the server crashes, but cant understand half, someone willing to explain?

Code:
Thread 2 "tfs" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff5f44700 (LWP 26639)]
0x00005555557e9b4e in std::__shared_ptr<OutputMessage, (__gnu_cxx::_Lock_policy)2>::operator bool (this=0x6d) at /usr/include/c++/9/bits/shared_ptr_base.h:1313
1313          { return _M_ptr == 0 ? false : true; }
(gdb) bt full
#0  0x00005555557e9b4e in std::__shared_ptr<OutputMessage, (__gnu_cxx::_Lock_policy)2>::operator bool (this=0x6d) at /usr/include/c++/9/bits/shared_ptr_base.h:1313
No locals.
#1  0x0000555555815e25 in Protocol::getOutputBuffer (this=0x55, size=62) at /home/otsmanager/custom/src/protocol.cpp:53
No locals.
#2  0x00005555558199f6 in ProtocolGame::writeToOutputBuffer (this=0x55, msg=...) at /home/otsmanager/custom/src/protocolgame.cpp:396
        out = std::shared_ptr<OutputMessage> (use count -128611512, weak count -1958166016) = {get() = 0x7ffff5f33940}
#3  0x000055555581fb0c in ProtocolGame::sendTextMessage (this=0x55, message=...) at /home/otsmanager/custom/src/protocolgame.cpp:1415
        msg = {static INITIAL_BUFFER_POSITION = 8, info = {length = 62, position = 70, overrun = false},
          buffer = "\000\000\246\346\\UUU\264\004:\000[RANDOM BOSS]: Boss dissapears in 2 minutes if not killed.\001\000\000\000H\002R\321\377\177\000\000\320\071\363\365\377\177\000\000\r\222ZUUU\000\000@\002R\321\377\177\000\000\360\071\363\365\377\177\000\000\351|ZUUU\000\000\360$A\337\377\377\377\377H\002R\321\377\177\000\000\020:\363\365\377\177\000\000ȑYUUU\000\000\350$A\337\377\377\377\377H\002R\321\377\177\000\000\060:\363\365\377\177\000\000\023\251YUUU\000\000\350$A\337\377\177\000\000@\002R\321\377\177\000\000"...}
#4  0x00005555555bf24a in Player::sendTextMessage (this=0x7fffdf605a60, message=...) at /home/otsmanager/custom/src/player.h:974
No locals.
#5  0x0000555555756c1b in LuaScriptInterface::luaPlayerSendTextMessage (L=0x40040378) at /home/otsmanager/custom/src/luascript.cpp:9278
        player = 0x7fffdf605a60
        parameters = 3
        message = {type = MESSAGE_STATUS_CONSOLE_BLUE, text = "[RANDOM BOSS]: Boss dissapears in 2 minutes if not killed.", position = {x = 0, y = 0, z = 0 '\000'}, channelId = 0, primary = {value = 0, color = 0}, secondary = {
            value = 0, color = -1}}
#6  0x00007ffff792bfb7 in ?? () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
No symbol table info available.
#7  0x00007ffff797a4a4 in lua_pcall () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
No symbol table info available.
#8  0x00005555556d57f0 in LuaScriptInterface::protectedCall (L=0x40040378, nargs=1, nresults=1) at /home/otsmanager/custom/src/luascript.cpp:300
        error_index = 4
        ret = 21845
#9  0x00005555556d6958 in LuaScriptInterface::callFunction (this=0x555555a3a500 <g_luaEnvironment>, params=1) at /home/otsmanager/custom/src/luascript.cpp:547
        result = false
        size = 5
#10 0x000055555576f7ce in LuaEnvironment::executeTimerEvent (this=0x555555a3a500 <g_luaEnvironment>, eventIndex=3449301) at /home/otsmanager/custom/src/luascript.cpp:16406
        env = 0x555555a3a6e0 <LuaScriptInterface::scriptEnv>
        it = {<std::__detail::_Node_iterator_base<std::pair<unsigned int const, LuaTimerEventDesc>, false>> = {_M_cur = 0x555555ef9040}, <No data fields>}
        timerEventDesc = {scriptId = 1242, function = 3375, parameters = std::vector of length 1, capacity 1 = {421}, eventId = 13571662}
#11 0x000055555578ded8 in std::__invoke_impl<void, void (LuaEnvironment::*&)(unsigned int), LuaEnvironment*&, unsigned int&> (__f=
    @0x7fffd0403470: (void (LuaEnvironment::*)(LuaEnvironment * const, unsigned int)) 0x55555576f5fa <LuaEnvironment::executeTimerEvent(unsigned int)>, __t=@0x7fffd0403488: 0x555555a3a500 <g_luaEnvironment>)
    at /usr/include/c++/9/bits/invoke.h:73
No locals.
#12 0x000055555578ac72 in std::__invoke<void (LuaEnvironment::*&)(unsigned int), LuaEnvironment*&, unsigned int&> (__fn=
    @0x7fffd0403470: (void (LuaEnvironment::*)(LuaEnvironment * const, unsigned int)) 0x55555576f5fa <LuaEnvironment::executeTimerEvent(unsigned int)>) at /usr/include/c++/9/bits/invoke.h:95
No locals.
#13 0x0000555555786290 in std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) (this=0x7fffd0403470, __args=...)
    at /usr/include/c++/9/functional:400
No locals.
#14 0x000055555577fdd5 in std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)>::operator()<, void>() (this=0x7fffd0403470) at /usr/include/c++/9/functional:484
No locals.
#15 0x0000555555779140 in std::_Function_handler<void (), std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)> >::_M_invoke(std::_Any_data const&) (__functor=...)
    at /usr/include/c++/9/bits/std_function.h:300
No locals.
#16 0x000055555589191a in std::function<void ()>::operator()() const (this=0x555555c35310) at /usr/include/c++/9/bits/std_function.h:688
No locals.
#17 0x0000555555891444 in Task::operator() (this=0x555555c35300) at /home/otsmanager/custom/src/tasks.h:40
No locals.
#18 0x0000555555891679 in Dispatcher::threadMain (this=0x555555a3b080 <g_dispatcher>) at /home/otsmanager/custom/src/tasks.cpp:60
        task = 0x555555c35300
        taskLockUnique = {_M_device = 0x555555a3b098 <g_dispatcher+24>, _M_owns = false}
#19 0x00005555557e52d4 in std::__invoke_impl<void, void (Dispatcher::*)(), Dispatcher*> (__f=@0x555555a6cae0: (void (Dispatcher::*)(Dispatcher * const)) 0x55555589156a <Dispatcher::threadMain()>,
    __t=@0x555555a6cad8: 0x555555a3b080 <g_dispatcher>) at /usr/include/c++/9/bits/invoke.h:73
No locals.
#20 0x00005555557e5003 in std::__invoke<void (Dispatcher::*)(), Dispatcher*> (__fn=@0x555555a6cae0: (void (Dispatcher::*)(Dispatcher * const)) 0x55555589156a <Dispatcher::threadMain()>) at /usr/include/c++/9/bits/invoke.h:95
No locals.
#21 0x00005555557e4b6f in std::thread::_Invoker<std::tuple<void (Dispatcher::*)(), Dispatcher*> >::_M_invoke<0ul, 1ul> (this=0x555555a6cad8) at /usr/include/c++/9/thread:244
No locals.
#22 0x00005555557e4573 in std::thread::_Invoker<std::tuple<void (Dispatcher::*)(), Dispatcher*> >::operator() (this=0x555555a6cad8) at /usr/include/c++/9/thread:251
--Type <RET> for more, q to quit, c to continue without paging--
 
Yeah could be so.

Im not using the newest repo for these 2 reasons:
1. I have everything setup with this old repo, means I will have to redo a lot custom features.
2. I cant compile it successfully in my ubuntu server, but i can compile it on my windows machine.
Linux - Issues compiling newest source on Ubuntu Linux (https://otland.net/threads/issues-compiling-newest-source-on-ubuntu-linux.275288/#post-2652820)

I'm unable to find out what the problem is by reading the crash report.
1. Monster goes idle.
2. Idle status is updated to true.
3. damageMap.clear() called. from this point on I am unable to come up with the reason of crash.
C++:
void Creature::onIdleStatus()
{
    if (getHealth() > 0) {
        damageMap.clear(); // this line.
        lastHitCreatureId = 0;
    }
}

I cant compile it successfully in my ubuntu server
because of FMT error?
have you tried building the library on your own:
Usage — fmt 7.1.3 documentation (https://fmt.dev/latest/usage.html#building-the-library)

@Mjmackan
Could you compile with cmake -DCMAKE_BUILD_TYPE=Debug .. for more readable crash info
 
Last edited:
Back
Top