• 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+ gdb error unsigned int where?

Mjmackan

Mapper ~ Writer
Premium User
Joined
Jul 18, 2009
Messages
1,424
Solutions
15
Reaction score
177
Location
Sweden
Anyone willing to explain?
I see there are warning about a unsigned int, is it referring to the storage saving in database or whats the problem?

C++:
Thread 2 "tfs" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff5f2b700 (LWP 2865)]
0x00005555555ba7f4 in std::less<unsigned int>::operator()(unsigned int const&, unsigned int const&) const ()
(gdb) bt full
#0  0x00005555555ba7f4 in std::less<unsigned int>::operator()(unsigned int const&, unsigned int const&) const ()
No symbol table info available.
#1  0x000055555583ecf4 in std::_Rb_tree<unsigned int, std::pair<unsigned int const, int>, std::_Select1st<std::pair<unsigned int const, int> >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, int> > >::_M_lower_bound(std::_Rb_tree_node<std::pair<unsigned int const, int> > const*, std::_Rb_tree_node_base const*, unsigned int const&) const ()
No symbol table info available.
#2  0x000055555583b18a in std::_Rb_tree<unsigned int, std::pair<unsigned int const, int>, std::_Select1st<std::pair<unsigned int const, int> >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, int> > >::find(unsigned int const&) const ()
No symbol table info available.
#3  0x0000555555837e07 in std::map<unsigned int, int, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, int> > >::find(unsigned int const&) const ()
No symbol table info available.
#4  0x00005555558263d0 in Player::getStorageValue(unsigned int, int&) const ()
No symbol table info available.
#5  0x00005555557831df in LuaScriptInterface::luaPlayerGetStorageValue(lua_State*) ()
No symbol table info available.
#6  0x00007ffff772dfb7 in ?? () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
No symbol table info available.
#7  0x00007ffff777c4a4 in lua_pcall () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
No symbol table info available.
#8  0x00005555556fbb7e in LuaScriptInterface::protectedCall(lua_State*, int, int) ()
No symbol table info available.
#9  0x00005555556fccb6 in LuaScriptInterface::callFunction(int) ()
No symbol table info available.
#10 0x000055555579f182 in LuaEnvironment::executeTimerEvent(unsigned int) ()
No symbol table info available.
#11 0x00005555557bc995 in void std::__invoke_impl<void, void (LuaEnvironment::*&)(unsigned int), LuaEnvironment*&, unsigned int&>(std::__invoke_memfun_deref, void (LuaEnvironment::*&)(unsigned int), LuaEnvironment*&, unsigned int&) ()
No symbol table info available.
#12 0x00005555557b9a41 in std::__invoke_result<void (LuaEnvironment::*&)(unsigned int), LuaEnvironment*&, unsigned int&>::type std::__invoke<void (LuaEnvironment::*&)(unsigned int), LuaEnvironment*&, unsigned int&>(void (LuaEnvironment::*&)(unsigned int), LuaEnvironment*&, unsigned int&) ()
No symbol table info available.
#13 0x00005555557b5308 in void std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) ()
No symbol table info available.
#14 0x00005555557af08d in void std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)>::operator()<, void>() ()
No symbol table info available.
#15 0x00005555557a87cb in std::_Function_handler<void (), std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)> >::_M_invoke(std::_Any_data const&) ()
No symbol table info available.
#16 0x00005555558cd6a2 in std::function<void ()>::operator()() const ()
No symbol table info available.
#17 0x00005555558cd114 in Task::operator()() ()
No symbol table info available.
#18 0x00005555558cd380 in Dispatcher::threadMain() ()
No symbol table info available.
#19 0x0000555555815520 in void std::__invoke_impl<void, void (Dispatcher::*)(), Dispatcher*>(std::__invoke_memfun_deref, void (Dispatcher::*&&)(), Dispatcher*&&) ()
No symbol table info available.
#20 0x0000555555815263 in std::__invoke_result<void (Dispatcher::*)(), Dispatcher*>::type std::__invoke<void (Dispatcher::*)(), Dispatcher*>(void (Dispatcher::*&&)(), Dispatcher*&&) ()
No symbol table info available.
#21 0x0000555555814df3 in void std::thread::_Invoker<std::tuple<void (Dispatcher::*)(), Dispatcher*> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) ()
No symbol table info available.
#22 0x000055555581480c in std::thread::_Invoker<std::tuple<void (Dispatcher::*)(), Dispatcher*> >::operator()() ()
No symbol table info available.
#23 0x0000555555813f58 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (Dispatcher::*)(), Dispatcher*> > >::_M_run() ()
No symbol table info available.
#24 0x00007ffff7e90de4 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#25 0x00007ffff7fa4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737319712512, 1168496747233141904, 140737488347438, 140737488347439,
                140737488347440, 140737319710592, -1168474660941601648, -1168479124656364400}, mask_was_saved = 0}}, priv = {
            pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = 0
#26 0x00007ffff7ccc133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
No locals.
(gdb)
 

C++:
#4  0x00005555558263d0 in Player::getStorageValue(unsigned int, int&) const ()
#10 0x000055555579f182 in LuaEnvironment::executeTimerEvent(unsigned int) ()

Somewhere in your datapack, you have an addEvent calling getStorageValue without validating the object (player)
 

C++:
#4  0x00005555558263d0 in Player::getStorageValue(unsigned int, int&) const ()
#10 0x000055555579f182 in LuaEnvironment::executeTimerEvent(unsigned int) ()

Somewhere in your datapack, you have an addEvent calling getStorageValue without validating the object (player)
Only way is by walking through everything or is there a way finding out where it sits?
 
Most of the IDE's have the advanced search function and generally the shortcut is Ctrl+Shift+F
This includes Sublime Text & Notepad++
 
or you are like me also retarded

upload datapack on github as privat then use search function xD
Hey, anything that works, works.
Post automatically merged:

Most of the IDE's have the advanced search function and generally the shortcut is Ctrl+Shift+F
This includes Sublime Text & Notepad++
I have 427 addEvents .
 
Last edited:
I cant for my life get this one, It must exist a way where I can get more info out of this, like script name and/or line!?
 
you can wrap this function:
Lua:
function example(x)
print(x)
return x*2
end

local wrapped = example

function example(x)
print(debug.getinfo(1).source)
local output = wrapped(x)
return output
end

example(1)
 
you can wrap this function:
Lua:
function example(x)
print(x)
return x*2
end

local wrapped = example

function example(x)
print(debug.getinfo(1).source)
local output = wrapped(x)
return output
end

example(1)
You say if I put this in like global and add it onto every addevent i get more info if it crashes and runs in gdb?
 
@Mjmackan Nah, he suggest to wrap addEvent and print there debug info before it gets executed, like (not tested):
Lua:
local oriAddEvent = addEvent

addEvent = function(...)
    print(debug.getinfo(2).source)
    return oriAddEvent(...)
end
 
@Mjmackan Nah, he suggest to wrap addEvent and print there debug info before it gets executed, like (not tested):
Lua:
local oriAddEvent = addEvent

addEvent = function(...)
    print(debug.getinfo(2).source)
    return oriAddEvent(...)
end
Oh thanks for explaining to me like a 5yr old, now i get it lols. Thanks, thats clever af. =D
 
Back
Top