• 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+ OTBR Tfs 1.3 Crashlog

adrenyslopez

Member
Joined
Dec 22, 2015
Messages
201
Reaction score
15
Hello good night, I have an error on my server sometimes it crashes and gives me this error in the crashlog.txt, I don't know if someone can help me or guide me what it could be, thanks in advance, I use otbr tfs 1.3

Lua:
---------------------------------------------------
Signal caught: SIGSEGV in 17/01 - 17:51:31

Thread 4 (Thread 0x7fffecbff700 (LWP 5384)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
No locals.
#1  0x00007ffff7b0b50c in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#2  0x0000555555756b5e in DatabaseTasks::threadMain() ()
No symbol table info available.
#3  0x00007ffff7b10e6f in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#4  0x00007ffff78414a4 in start_thread (arg=0x7fffecbff700) at pthread_create.c:456
        __res = <optimized out>
        pd = 0x7fffecbff700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737165391616, -3289042186935040381, 140737184339262, 140737184339263, 140737157001216, 3, 3289071323425703555, 3289059870676649603}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#5  0x00007ffff51bed0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
No locals.

Thread 3 (Thread 0x7fffed612700 (LWP 5383)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225
No locals.
#1  0x00005555556450c2 in Scheduler::threadMain() ()
No symbol table info available.
#2  0x00007ffff7b10e6f in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#3  0x00007ffff78414a4 in start_thread (arg=0x7fffed612700) at pthread_create.c:456
        __res = <optimized out>
        pd = 0x7fffed612700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737175955200, -3289042186935040381, 140737488346430, 140737488346431, 140737167564800, 3, 3289073914901595779, 3289059870676649603}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#4  0x00007ffff51bed0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
No locals.

Thread 2 (Thread 0x7fffede13700 (LWP 5382)):
#0  0x0000555555718a8d in Game::internalCreatureTurn(Creature*, Direction) [clone .constprop.836] ()
No symbol table info available.
#1  0x000055555561cea3 in NpcScriptInterface::luaSetNpcFocus(lua_State*) ()
No symbol table info available.
#2  0x00007ffff716d106 in ?? () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
No symbol table info available.
#3  0x00007ffff71b2a10 in lua_pcall () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
No symbol table info available.
#4  0x00005555557983a8 in LuaScriptInterface::protectedCall(lua_State*, int, int) ()
No symbol table info available.
#5  0x000055555579e67f in LuaScriptInterface::callFunction(int) ()
No symbol table info available.
#6  0x0000555555709265 in Game::internalCreatureSay(Creature*, SpeakClasses, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::unordered_set<Creature*, std::hash<Creature*>, std::equal_to<Creature*>, std::allocator<Creature*> >*, Position const*, bool) [clone .constprop.369] ()
No symbol table info available.
#7  0x000055555573db25 in Game::playerNpcGreet(unsigned int, unsigned int) ()
No symbol table info available.
#8  0x000055555566bc7a in Dispatcher::threadMain() ()
No symbol table info available.
#9  0x00007ffff7b10e6f in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#10 0x00007ffff78414a4 in start_thread (arg=0x7fffede13700) at pthread_create.c:456
        __res = <optimized out>
        pd = 0x7fffede13700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737184347904, -3289042186935040381, 140737488346430, 140737488346431, 140737175957504, 3, 3289072815926838915, 3289059870676649603}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#11 0x00007ffff51bed0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
No locals.

Thread 1 (Thread 0x7ffff7fd6780 (LWP 5378)):
#0  0x00007ffff51bf303 in epoll_wait () at ../sysdeps/unix/syscall-template.S:84
No locals.
#1  0x0000555555590068 in main ()
No symbol table info available.
$1 = 0
 
I am not sure of this, however the only thing I can spot at all is
"No symbol table info available."

After a quick search on google:
I am guessing it has to do with GBD and your libs,
did you install them correctly?
Lua:
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install git cmake build-essential libluajit-5.1-dev ca-certificates curl zip unzip tar pkg-config

You can find a tutorial page here:

Kids, don't listen to me. Listen to Gesior downbelow xD
 
Last edited:
I am not sure of this, however the only thing I can spot at all is
"No symbol table info available."

After a quick search on google:
I am guessing it has to do with GBD and your libs,
did you install them correctly?
Lua:
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install git cmake build-essential libluajit-5.1-dev ca-certificates curl zip unzip tar pkg-config

You can find a tutorial page here:
is it something with the libs? I thought it was something related to an NPC, in my opinion they are some players that are crashing the server
 
I found why it crashes. In game.cpp in function Game::playerNpcGreet replace:
C++:
SpectatorHashSet spectators;
spectators.insert(npc);
map.getSpectators(spectators, player->getPosition(), true, true);
internalCreatureSay(player, TALKTYPE_SAY, "hi", false, &spectators);
spectators.clear();
spectators.insert(npc);
if (npc->getSpeechBubble() == SPEECHBUBBLE_TRADE) {
   internalCreatureSay(player, TALKTYPE_PRIVATE_PN, "trade", false, &spectators);
} else {
   internalCreatureSay(player, TALKTYPE_PRIVATE_PN, "sail", false, &spectators);
}
with:
C++:
SpectatorHashSet npcSpectator;
npcSpectator.insert(npc);
internalCreatureSay(player, TALKTYPE_SAY, "Hi", false, &npcSpectator);

SpectatorHashSet spectators;
map.getSpectators(spectators, player->getPosition(), true, true);
internalCreatureSay(player, TALKTYPE_SAY, "Hi", false, &spectators);

if (npc->getSpeechBubble() == SPEECHBUBBLE_TRADE) {
   internalCreatureSay(player, TALKTYPE_PRIVATE_PN, "Trade", false, &npcSpectator);
} else {
   internalCreatureSay(player, TALKTYPE_PRIVATE_PN, "Sail", false, &npcSpectator);
}
Someone insert npc into spectators list, which is list used in playersSpectatorCache in map.cpp. When NPC turns to player, it loads list of players on screen from map.cpp cache and tries to send network packet to them. On list is NPC, not player, so it crashes.
 
The problem is in the internalCreatureTurn function which is not checking the player pointer!

In the Game::internalCreatureTurn function, change from:

C++:
        spectator->getPlayer()->sendCreatureTurn(creature);
For:

C++:
        Player* tmpPlayer = spectator->getPlayer();
        if(!tmpPlayer) {
            continue;
        }
        tmpPlayer->sendCreatureTurn(creature);

Only this is important to solve the crash, the rest is indentation.
 
Last edited:
I found why it crashes. In game.cpp in function Game::playerNpcGreet replace:
C++:
SpectatorHashSet spectators;
[B]spectators.insert(npc);[/B]
map.getSpectators(spectators, player->getPosition(), true, true);
internalCreatureSay(player, TALKTYPE_SAY, "hi", false, &spectators);
[B]spectators.clear();
spectators.insert(npc);[/B]

@Gesior.pl do you know why they insert npc into spectators to clean it and afterwards, inserting it again? And why didn't you do the same in your fix?
 
The problem is in the internalCreatureTurn function which is not checking the player pointer!
Problem is that someone get spectators list with onlyPlayers = true, which gets into map.cpp cache. Then remove players from it and put 1 NPC into it. List of spectators passed to internalTurnCreature should contain only `Player`s.
It caches that list here otservbr-global/map.cpp at main · opentibiabr/otservbr-global (https://github.com/opentibiabr/otservbr-global/blob/main/src/map/map.cpp#L467)
Code:
playersSpectatorCache[centerPos] = spectators;
and it looks like it does not copy whole list (deep clone), only pointer to list. So by modifying spectators in Game::playerNpcGreet, it modifies playersSpectatorCache in map.cpp.
do you know why they insert npc into spectators to clean it and afterwards
I don't know. Looks like someone wanted to use 1 variable less and 1 function call less.
 
Back
Top