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

C++ SIGSEGV at Tile::hasProperty(ITEMPROPERTY)

pasiak12

Well-Known Member
Joined
Jun 7, 2009
Messages
261
Solutions
13
Reaction score
71
I am using the OTX3 version

I am having strange sigsegv crash at random time and players can't really tell what is causing the crash.

Theres the gdb log:
[GDB] (gdb) bt full #0 0x0000000000795074 in Tile::hasProperty(ITEMPROPERTY) const - Pastebin.com

Seems like it is crashing while using some area combat spell at the hasPropety Tile function.

C++:
bool Tile::hasProperty(ITEMPROPERTY prop) const
{
    if (ground && ground->hasProperty(prop)) {
        return true;
    }

    if (const TileItemVector* items = getItemList()) {
        for (const Item* item : *items) {
            if (item)// I've put this just in case, but didnt help
                if (item->hasProperty(prop)) {
                    return true;
                }
        }
    }
    return false;
}

Has anyone met this problem before?

Thanks in advance
 
Last edited:
The tile is null(this==nullptr) so all the other variables that gdb printed are meaningless (they don't exist). The crash is caused, because an AoE combat object has been executed near the map border (in a place where there is no tile) which causes the crash on this otxserver/combat.cpp at otxserv3 · mattyx14/otxserver · GitHub line.
 
Solution
The tile is null(this==nullptr) so all the other variables that gdb printed are meaningless (they don't exist). The crash is caused, because an AoE combat object has been executed near the map border (in a place where there is no tile) which causes the crash on this otxserver/combat.cpp at otxserv3 · mattyx14/otxserver · GitHub line.

Thank you for help!

I will try to fix this with
C++:
    if(!tile)
        return;


p.s.
Can you tell me where you read that tile was NULL in that gdb log?
 
Last edited:
Back
Top