• 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!

Linux Crash with gdb game::doPlayerMoveUpContainer TFS 1.2 Ubuntu 14.

Loira

New Member
Joined
Aug 13, 2007
Messages
48
Reaction score
0
Hello, my server is crashing sometime and i don'w know why. Many players know the bug because they trying duplicate items.

Im using Ubuntu 14, Otx 3.6 (Tfs 1.2) here is the sources:
https://github.com/mattyx14/otxserver/tree/otxserv3/path_8_6

Please i can pay for this solution with paypal, its urgent!

This is the gdb report when crash:

Code:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x64a5286f8700 (LWP 6073)]
0x000000000080e746 in Game::playerMoveUpContainer(unsigned int, unsigned char) ()
(gdb) bt full
#0  0x000000000080e746 in Game::playerMoveUpContainer(unsigned int, unsigned char) ()
No symbol table info available.
#1  0x00000000009a0748 in void std::_Mem_fn<void (Game::*)(unsigned int, unsigned char)>::operator()<unsigned int&, unsigned char&, void>(Game*, unsigned int&, unsigned char&) const ()
No symbol table info available.
#2  0x000000000099e2f8 in void std::_Bind<std::_Mem_fn<void (Game::*)(unsigned int, unsigned char)> (Game*, unsigned int, unsigned char)>::__call<void, , 0ul, 1ul, 2ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul, 2ul>) ()
No symbol table info available.
#3  0x000000000099b2ac in void std::_Bind<std::_Mem_fn<void (Game::*)(unsigned int, unsigned char)> (Game*, unsigned int, unsigned char)>::operator()<, void>() ()
No symbol table info available.
#4  0x000000000099491c in std::_Function_handler<void (), std::_Bind<std::_Mem_fn<void (Game::*)(unsigned int, unsigned char)> (Game*, unsigned int, unsigned char)> >::_M_invoke(std::_Any_data const&) ()
No symbol table info available.
#5  0x00000000009cd542 in std::function<void ()>::operator()() const ()
No symbol table info available.
#6  0x00000000009cd42c in Task::operator()() ()
No symbol table info available.
#7  0x00000000009cccd4 in Dispatcher::threadMain() ()
No symbol table info available.
#8  0x000000000094bb1d in void std::_Mem_fn<void (Dispatcher::*)()>::operator()<, void>(Dispatcher*) const ()
No symbol table info available.
#9  0x000000000094b58b in void std::_Bind_simple<std::_Mem_fn<void (Dispatcher::*)()> (Dispatcher*)>::_M_invoke<0ul>(std::_Index_tuple<0ul>) ()
No symbol table info available.
#10 0x000000000094aee7 in std::_Bind_simple<std::_Mem_fn<void (Dispatcher::*)()> (Dispatcher*)>::operator()() ()
No symbol table info available.
#11 0x000000000094a8ce in std::thread::_Impl<std::_Bind_simple<std::_Mem_fn<void (Dispatcher::*)()> (Dispatcher*)> >::_M_run() ()
No symbol table info available.
#12 0x000064a52993aa60 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#13 0x000064a529b95184 in start_thread (arg=0x64a5286f8700) at pthread_create.c:312
        __res = <optimised out>
        pd = 0x64a5286f8700
        now = <optimised out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {110660510779136, 8599761939677527988, 1, 0, 110660510779840, 110660510779136, -4750684949879242828, -4750683422022877260},
              mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimised out>
        pagesize_m1 = <optimised out>
        sp = <optimised out>
        freesize = <optimised out>
        __PRETTY_FUNCTION__ = "start_thread"
#14 0x000064a5290a237d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
No locals.
(gdb)
 
Show this func
doPlayerMoveUpContainer

Code:
void Game::playerMoveUpContainer(uint32_t playerId, uint8_t cid)
{
    Player* player = getPlayerByID(playerId);
    if (!player) {
        return;
    }

    Container* container = player->getContainerByID(cid);
    if (!container) {
        return;
    }

    Container* parentContainer = dynamic_cast<Container*>(container->getRealParent());
    if (!parentContainer) {
        Tile* tile = container->getTile();
        if (!tile) {
            return;
        }
    }

    player->addContainer(cid, parentContainer);
    player->sendContainer(cid, parentContainer, parentContainer->hasParent(), player->getContainerIndex(cid));
}
 
Code:
void Game::playerMoveUpContainer(uint32_t playerId, uint8_t cid)
{
    Player* player = getPlayerByID(playerId);
    if (!player) {
        return;
    }

    Container* container = player->getContainerByID(cid);
    if (!container) {
        return;
    }

    Container* parentContainer = dynamic_cast<Container*>(container->getRealParent());
    if (!parentContainer) {
        return;
    }

    player->addContainer(cid, parentContainer);
    player->sendContainer(cid, parentContainer, parentContainer->hasParent(), player->getContainerIndex(cid));
}

@MartyX i think there is a crash bug in your 8.60 1.2 distro, check this code:

https://github.com/mattyx14/otxserver/blob/otxserv3/path_8_6/src/game.cpp#L2095

This code was made for browser field. In tfs 1.x there is a reason they get the tile with container->getTile(): They will use it to get the browser field container.
parentContainer will likely be null(which makes the crash happen) and container->getTile() won't do anything to fix it.
 
Back
Top