• 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] Segmentation fault Item::isRemoved

QuebradaZN

Member
Joined
May 5, 2019
Messages
43
Solutions
3
Reaction score
6
I recently opened my server and I've been getting this log in gdb for a few days now, I don't know when this happens and how to do it, I've done checks in thousands of places, tried to run Crash in all ways and was not successful! forgive my english



Error Log!
Code:
2021-12-06 00:49:12 -  Thread 2 (Thread 0x7ffff5c66700 (LWP 265632)):
2021-12-06 00:49:12 -  #0  0x00007fffa9b52e48 in ?? ()
2021-12-06 00:49:12 -  No symbol table info available.
2021-12-06 00:49:12 -  #1  0x000055555565c5d8 in Item::isRemoved (this=0x7fff9b0c5be0) at /home/otserv/src/item.h:1067
2021-12-06 00:49:12 -  No locals.
2021-12-06 00:49:12 -  #2  0x000055555565c5d8 in Item::isRemoved (this=0x7fffd3fac350) at /home/otserv/src/item.h:1067
2021-12-06 00:49:12 -  No locals.
2021-12-06 00:49:12 -  #3  0x00005555556a05e3 in Item::canDecay (this=0x7fffd3fac350) at /home/otserv/src/item.cpp:2267
2021-12-06 00:49:12 -          it = @0x7ffff5c65968: {group = 1598839504, type = 32767, id = 1, clientId = 0, stackable = false, isAnimation = false, name = "", article = <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>, pluralName = "", description = "", runeSpellName = "\311\303UH\211\345H\203\354\020H\211}\370H\213E\370H\211\307\350\233/\376\377\311\303UH\211\345H\203\354\020H\211}\370H\213E\370H\211\307\350\200\000\377\377\311\303UH\211\345H\211}\370H\213E\370]\303UH\211\345ATSH\203\354 H\211}\350H\211u\340H\211U\330H\213E\340H\211\307\350\027\377\377\377H\213\000H\213U\350H\213R\bL\215$\020H\213U\350H\213\022\203\342\001H\205\322t!H\213U\350H\213R\bH\001\320H\213\020H\213E\350H\213\000H\203\350\001H\001\320H\213\030\353\aH\213E\350H\213\030H\213E\330H\211\307\350i\034\367\377\213\000H\230H\211\306L\211\347\377\323H\203", <incomplete sequence \304>..., vocationString = "H\213E\350dH3\004%(\000\000\000t\005\350N4\366\377H\203\304([]ÐUH\211\345SH\203\354\020H\211}\360H\211u\350H\213]\360H\213E\350H\211\307\350\234\f\367\377H\211\306H\211\337\350\316l\377\377H\203\304\020[]\303UH\211\345H\211}\370H\213E\370]\303UH\211\345H\203\354\020H\211}\370H\213E\370H\211\307\350\325k\000\000\311\303UH\211\345H\203\354\020H\211}\370H\213E\370H\211\307\350\325k\000\000\311\303UH\211\345ATSH\203\354\060H\211}\330H\211u\320H\211U\310dH\213\004%(\000\000\000H\211E\350\061\300H\213E\310H\211\307览\367\377I\211\304H\213"..., abilities = std::unique_ptr<Abilities> = {get() = 0x33b47501564cf800}, conditionDamage = std::unique_ptr<ConditionDamage> = {get() = 0x7fff0cd86120}, weight = 1438254216, levelDoor = 21845, decayTime = 4123417216, wieldInfo = 32767, minReqLevel = 1432509139, minReqMagicLevel = 21845, charges = 4123417255, maxHitChance = 32767, decayTo = 215507216, attack = 32767, defense = 252226176, extraDefense = 32767, armor = 1447884800, imbuingSlots = 867464449, rotateTo = -171550032, runeMagLevel = 32767, runeLevel = 1432455479, wrapableTo = 21845, combatType = 23216, transformToOnUse = {62918, 32767}, transformToFree = 0, destroyTo = 24848, maxTextLen = 3288, writeOnceItemId = 32767, transformEquipTo = 0, transformDeEquipTo = 23264, maxItems = 62918, slotPosition = 32767, speed = 0, wareId = 63488, magicEffect = CONST_ME_CONFETTI_VERTICAL, bedPartnerDir = 86, weaponType = WEAPON_SWORD, ammoType = 117, shootType = -76, corpseType = 51, fluidSource = -48, floorChange = 90 'Z', alwaysOnTopOrder = 198 '\306', lightLevel = 245 '\365', lightColor = 255 '\377', shootRange = 127 '\177', hitChance = 0 '\000', forceUse = false, hasHeight = 67, walkStack = 181, blockSolid = 96, blockPickupable = 85, blockProjectile = 85, blockPathFind = 85, allowPickupable = false, showDuration = false, showCharges = 192, showAttributes = 17, replaceable = 85, pickupable = 208, rotatable = 255, wrapable = 127, wrapContainer = false, useable = false, moveable = 128, alwaysOnTop = 170, canReadText = 8, canWriteText = 15, isVertical = 255, isHorizontal = 127, isHangable = false, allowDistRead = false, lookThrough = 240, stopTime = 90, showCount = 198}
 
what happens when you /i 32767 and look on it?
what is 32767 on your server?
do you use it with addEvent somewhere?
 
Last edited:
post the code
Lua:
local config ={
    time = 10, -- minutos coloca 1 aqui pra tu testar
    positionKick = Position(33863, 31029, 11), -- position p onde vai kickar o cara
}

local centerRoom = Position(33777, 30998, 11)

local clearEsquerdo = Position(33759, 30985, 11)
local clearDireito = Position(33793, 31009, 11)

local function resetRoom(centerPosition, rangeX, rangeY, resetGlobalStorage)
    local spectators,
    spectator = Game.getSpectators(centerPosition, false, false, rangeX, rangeX, rangeY, rangeY)
    for i = 1, #spectators do
        spectator = spectators[i]
        if spectator:isPlayer() then
            return true -- ele vai checar primeiro se tem gente dentro, se tiver a função não faz nada
        end
    end
    for i = 1, #spectators do
        spectator = spectators[i]
        if spectator:isMonster() then
            spectator:remove() -- se ver que ÑÃO tem player, ele deleta todos os montros e reseta a sala pra a galera que tá puxando a alavanca já
        end
    end
    if Game.getStorageValue(resetGlobalStorage) == 1 then
        Game.setStorageValue(resetGlobalStorage, -1)
    end
end

local function kickFroomRoom(playersTable)
    for _, pid in pairs(playersTable) do
        local player = Player(pid)
        if player then
            if player:getPosition():isInRange(clearEsquerdo, clearDireito) then
                player:teleportTo(config.positionKick)
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You were kicked for exceding the time inside the room.")
            end
        end
    end
end   

--[[
a ordem tá a seguinte:
ao puxar a alavanca, ele checa se tem gente dentro da sala
se tiver, cancela
se não tiver, ele já reseta a sala naa hora mesmo
daí começa o timer de 10 segundos SÓ PRA KICKAR OS PLAYERS, não remove monstro nem nada
pq os monstros sempre vão ser removidos ao puxar a alavanca
]]     

local t = {
    players = {
        [1] = Position(33865, 31025, 11),
        [2] = Position(33863, 31023, 11),
        [3] = Position(33863, 31025, 11),
        [4] = Position(33863, 31027, 11),
        [5] = Position(33861, 31025, 11)
    },
    
    boss = {name = "Demon King", create_pos = Position(33790, 30998, 11)},
 
    bossSummon = {name = "Demon King", create_pos = Position(33773, 30997, 11)},
    bossSummon2 = {name = "Demon King", create_pos = Position(33776, 31005, 11)},
 
    bossSummon3 = {name = "Demon King", create_pos = Position(33781, 30997, 11)},
    bossSummon4 = {name = "Demon King", create_pos = Position(33762, 31002, 11)},
    
    bossSummon5 = {name = "Demon King", create_pos = Position(33780, 30991, 11)},
    bossSummon6 = {name = "Demon King", create_pos = Position(33784, 30991, 11)},
 
    destination = Position(33760, 31002, 11),
    
    cooldown = {20, "min"},
    
    storageEvent = Storage.GraveDanger.WaveStorage,
    storage = Storage.GraveDanger.WaveTimer
}
local wavequestlever = Action()
function wavequestlever.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local players, tab = {}, t.players
    for i = 1, #tab do
        local tile = Tile(tab[i])
        if tile then
            local p = Player(tile:getTopCreature())
            if p then
                if p:getStorageValue(t.storage) <= os.time() then
                    players[#players + 1] = p:getId()
                end
            end
        end
    end
    if #players == 0 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "None of the players did not wait " .. getStrTime(t.cooldown) .. " to go again.")
        return true
    elseif resetRoom(centerRoom, clearEsquerdo, clearDireito, t.storageEvent, false) then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Looks like someone is inside the room.")
        return true
    end
    for i = 1, #tab do
        local playerTile = Tile(tab[i])
        local playerToGo = Player(playerTile:getTopCreature())
        if playerToGo then
            if isInArray(players, playerToGo:getId()) then
                playerToGo:setStorageValue(t.storage, mathtime(t.cooldown) + os.time())
                playerTile:relocateTo(t.destination)
                addEvent(kickFroomRoom, config.time*60*1000, players)
                tab[i]:sendMagicEffect(CONST_ME_POFF)
            end
        end
    end
    
        addEvent(function()
            Game.createMonster(t.boss.name, t.boss.create_pos, false, true)
            Game.createMonster(t.bossSummon.name, t.bossSummon.create_pos, false, true) -- o ideal seria isso aqui
            Game.createMonster(t.bossSummon2.name, t.bossSummon2.create_pos, false, true)
            Game.createMonster(t.bossSummon3.name, t.bossSummon3.create_pos, false, true)
            Game.createMonster(t.bossSummon4.name, t.bossSummon4.create_pos, false, true)
            Game.createMonster(t.bossSummon5.name, t.bossSummon5.create_pos, false, true)
            Game.createMonster(t.bossSummon6.name, t.bossSummon6.create_pos, false, true)
        end, 1000)
    t.destination:sendMagicEffect(CONST_ME_TELEPORT)
    
    item:transform(item.itemid == 9825 and 9826 or 9825)
    return true
end

function mathtime(table)
local unit = {"sec", "min", "hour", "day"}
for i, v in pairs(unit) do
if v == table[2] then
return table[1]*(60^(v == unit[4] and 2 or i-1))*(v == unit[4] and 24 or 1)
end
end
return error("Bad declaration in mathtime function.")
end

function getStrTime(table)
local unit = {["sec"] = "second",["min"] = "minute",["hour"] = "hour",["day"] = "day"}
return tostring(table[1].." "..unit[table[2]]..(table[1] > 1 and "s" or ""))
end

wavequestlever:aid(7002)
wavequestlever:register()

I use this as a base, but I have several others like it, just changed coordinates, summon and aid
 
It doesn't seems to be this script the issue, try to look to any script that have addEvent like this:
Lua:
addEvent(function()
    --function body
end, anytimehere)
Where in the function body you using a item userdata, such as:
Item:transform(), item:remove(), item:decay() or any other item function
 
It doesn't seems to be this script the issue, try to look to any script that have addEvent like this:
Lua:
addEvent(function()
    --function body
end, anytimehere)
Where in the function body you using a item userdata, such as:
Item:transform(), item:remove(), item:decay() or any other item function
I'll do the checks, even with logs I don't know where to look
 
It doesn't seems to be this script the issue, try to look to any script that have addEvent like this:
Lua:
addEvent(function()
    --function body
end, anytimehere)
Where in the function body you using a item userdata, such as:
Item:transform(), item:remove(), item:decay() or any other item function
Good night, I spent all day looking for Item:transform(), item:remove(), item:decay() or any other function, the only script I found with these functions was dawnport, but I don't use dawnport or rook , I believe it's not there... I checked all the custom scripts and I didn't find anything like that, do you have any idea of something to help me? Sorry the English
 
Back
Top