• 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+ Crash when player logout or die [tfs 1.3]

Seitron

New Member
Joined
Jun 28, 2020
Messages
27
Reaction score
2
Hi, I'm having trouble solving this. I don't have much experience and I don't find a similar error on the internet.

It is not always that the player logs out or dies, sometimes it is hours without problems.
I will post the log, if anyone can help me solve it I would be very grateful.

Using Ubuntu 20

Log:
 
what caused the crash is the destructor for some Container inside of DepotLocker it seems, what does that character's depot locker contain?
it's hard to pinpoint the issue with no symbols
 
Try upgrading MariaDB to latest version

I was using mariaDB 10.3. I found the latest version 10.5. It had no effect .
Post automatically merged:

what caused the crash is the destructor for some Container inside of DepotLocker it seems, what does that character's depot locker contain?
it's hard to pinpoint the issue with no symbols

I'll see if I find any items that players have in common. The strange thing that doesn't always happen, even keeping the same items in the depot.
Post automatically merged:
 
Last edited:
I recompile using
cmake -DCMAKE_BUILD_TYPE=DEBUG ..

I got this more detailed log, if you can help me

 
in my game.cpp in the same part there are more details. Should I delete it or is it more updated?

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

        auto it = browseFields.find(tile);
        if (it == browseFields.end()) {
            parentContainer = new Container(tile);
            parentContainer->incrementReferenceCounter();
            browseFields[tile] = parentContainer;
            g_scheduler.addEvent(createSchedulerTask(30000, std::bind(&Game::decreaseBrowseFieldRef, this, tile->getPosition())));
        } else {
            parentContainer = it->second;
        }
    }
 
It would be easier if you'll provide the source code. The lines described in your gdb log does not match the newest TFS.
Have you modified Container's code anyhow? Could you provide TFS version (commit hash) you use or Container class source code?

Easiest solution: If it is possible, try to use the newest TFS and check if the problem still occurs.
 
At first glance I am not sure what might be causing the problem, but...
It looks strange that Container's destructors are displayed twice in stack trace (I don't understand why it might happen, probably just a compiler artifact - meaningless).
Code:
2020-08-26 05:46:27 -  #1  0x000055555564fe9c in Container::~Container (this=<optimized out>, this=<optimized out>) at /home/otserv1/src/container.cpp:69
2020-08-26 05:46:27 -          item = 0x7fff422d3700
2020-08-26 05:46:27 -          __for_range = std::deque with 18 elements = {0x7fff422d3700, 0x7fff7f9d1e00, 0x7fff61871630, 0x7fff61abdd40, 0x7fffc4057a20, 0x7fff61b4f460, 0x7fff9402e5e0, 0x7fff26ae3a50, 0x7fff3e53a040, 0x7fff7fbb7bb0, 0x7fff61b51ab0, 0x7fff616575a0, 0x7fff61ba4d20, 0x7fff360df220, 0x7fffa7173ed0, 0x7fff9f945ae0, 0x7fffcf29da00, 0x7fffcee80d80}
2020-08-26 05:46:27 -          __for_begin = 0x7fff422d3700
2020-08-26 05:46:27 -          __for_end = 0x7fffc0b24400
2020-08-26 05:46:27 -          item = <optimized out>
2020-08-26 05:46:27 -          __for_range = <optimized out>
2020-08-26 05:46:27 -          __for_begin = <optimized out>
2020-08-26 05:46:27 -          __for_end = <optimized out>
2020-08-26 05:46:27 -          item = <optimized out>
2020-08-26 05:46:27 -          __for_range = <optimized out>
2020-08-26 05:46:27 -          __for_begin = <optimized out>
2020-08-26 05:46:27 -          __for_end = <optimized out>
2020-08-26 05:46:27 -  #2  0x000055555564ff0e in Container::~Container (this=<optimized out>, this=<optimized out>) at /home/otserv1/src/container.cpp:73

Also it looks like it is failing at line 69:
Code:
item->setParent(nullptr);
And the next step is not refering to setParent:
Code:
2020-08-26 05:46:27 -  #0  0x00007fff422d36f0 in ?? ()
It probably means that the item is already nulled.

Try to print its name and address. It will allow you to check what items are being removed. If it was already removed then you should check why it is trying to be removed once again.
 
Back
Top