• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 1.2 Crash - How to locate a specific Lua script?

Darius93

Active Member
Joined
Oct 16, 2022
Messages
88
Reaction score
27
Hello, I had this kind of crash:

Code:
2025-11-13 18:07:00 -  Thread 2 "tfs" received signal SIGSEGV, Segmentation fault.
2025-11-13 18:07:00 -  [Switching to Thread 0x7ffff5db26c0 (LWP 737833)]
2025-11-13 18:07:00 -  0x000055555558aae8 in ItemAttributes::hasAttribute(itemAttrTypes) const ()
2025-11-13 18:07:00 - 
2025-11-13 18:07:00 -  Thread 4 (Thread 0x7ffff4db06c0 (LWP 737835) "tfs"):
2025-11-13 18:07:00 -  #0  __syscall_cancel_arch () at ../sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S:56
2025-11-13 18:07:00 -  No locals.
2025-11-13 18:07:00 -  #1  0x00007ffff709eae3 in __internal_syscall_cancel (a1=a1@entry=93824996481780, a2=<optimized out>, a3=a3@entry=1435900504, a4=a4@entry=0, a5=a5@entry=0, a6=a6@entry=4294967295, nr=202) at ./nptl/cancellation.c:49
2025-11-13 18:07:00 -          result = <optimized out>
2025-11-13 18:07:00 -          pd = <optimized out>
2025-11-13 18:07:00 -          ch = <optimized out>
2025-11-13 18:07:00 -  #2  0x00007ffff709f237 in __futex_abstimed_wait_common64 (private=0, futex_word=0x555555961af4 <g_databaseTasks+180>, expected=1435900504, op=393, abstime=0x0, cancel=true) at ./nptl/futex-internal.c:57
2025-11-13 18:07:00 -          resultvar = <optimized out>
2025-11-13 18:07:00 -          __arg6 = <optimized out>
2025-11-13 18:07:00 -          __arg5 = <optimized out>
2025-11-13 18:07:00 -          __arg4 = <optimized out>
2025-11-13 18:07:00 -          __arg3 = <optimized out>
2025-11-13 18:07:00 -          __arg2 = <optimized out>
2025-11-13 18:07:00 -          __arg1 = <optimized out>
2025-11-13 18:07:00 -          _a6 = <optimized out>
2025-11-13 18:07:00 -          _a5 = <optimized out>
2025-11-13 18:07:00 -          _a4 = <optimized out>
2025-11-13 18:07:00 -          _a3 = <optimized out>
2025-11-13 18:07:00 -          _a2 = <optimized out>
2025-11-13 18:07:00 -          _a1 = <optimized out>
2025-11-13 18:07:00 -  #3  __futex_abstimed_wait_common (futex_word=0x555555961af4 <g_databaseTasks+180>, expected=1435900504, clockid=0, abstime=0x0, private=0, cancel=true) at ./nptl/futex-internal.c:87
2025-11-13 18:07:00 -          err = <optimized out>
2025-11-13 18:07:00 -          clockbit = 256
2025-11-13 18:07:00 -          op = 393
2025-11-13 18:07:00 -          err = <optimized out>
2025-11-13 18:07:00 -          clockbit = <optimized out>
2025-11-13 18:07:00 -          op = <optimized out>
2025-11-13 18:07:00 -  #4  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x555555961af4 <g_databaseTasks+180>, expected=expected@entry=265, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
2025-11-13 18:07:00 -  No locals.
2025-11-13 18:07:00 -  #5  0x00007ffff70a1b17 in __pthread_cond_wait_common (cond=<optimized out>, mutex=0x555555961aa8 <g_databaseTasks+104>, clockid=0, abstime=0x0) at ./nptl/pthread_cond_wait.c:426
2025-11-13 18:07:00 -          signals = 265
2025-11-13 18:07:00 -          g1_start = <optimized out>
2025-11-13 18:07:00 -          buffer = {__routine = 0x7ffff70a18b0 <__condvar_cleanup_waiting>, __arg = 0x7ffff4dafc70, __canceltype = -186975104, __prev = 0x0}
2025-11-13 18:07:00 -          cbuffer = {wseq = 535, cond = 0x555555961ad0 <g_databaseTasks+144>, mutex = 0x555555961aa8 <g_databaseTasks+104>, private = 0}
2025-11-13 18:07:00 -          err = <optimized out>
2025-11-13 18:07:00 -          wseq = <optimized out>
2025-11-13 18:07:00 -          g = <optimized out>
2025-11-13 18:07:00 -          seq = 267
2025-11-13 18:07:00 -          flags = <optimized out>
2025-11-13 18:07:00 -          private = 0
2025-11-13 18:07:00 -          result = 0
2025-11-13 18:07:00 -          err = <optimized out>
2025-11-13 18:07:00 -          result = <optimized out>
2025-11-13 18:07:00 -          wseq = <optimized out>
2025-11-13 18:07:00 -          g = <optimized out>
2025-11-13 18:07:00 -          seq = <optimized out>
2025-11-13 18:07:00 -          flags = <optimized out>
2025-11-13 18:07:00 -          private = <optimized out>
2025-11-13 18:07:00 -          signals = <optimized out>
2025-11-13 18:07:00 -          g1_start = <optimized out>
2025-11-13 18:07:00 -          buffer = <optimized out>
2025-11-13 18:07:00 -          cbuffer = <optimized out>
2025-11-13 18:07:00 -  #6  ___pthread_cond_wait (cond=<optimized out>, mutex=0x555555961aa8 <g_databaseTasks+104>) at ./nptl/pthread_cond_wait.c:458
2025-11-13 18:07:00 -  No locals.
2025-11-13 18:07:00 -  #7  0x0000555555611bc2 in DatabaseTasks::threadMain() ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #8  0x0000555555614a77 in void std::__invoke_impl<void, void (DatabaseTasks::*)(), DatabaseTasks*>(std::__invoke_memfun_deref, void (DatabaseTasks::*&&)(), DatabaseTasks*&&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #9  0x00005555556149dd in std::__invoke_result<void (DatabaseTasks::*)(), DatabaseTasks*>::type std::__invoke<void (DatabaseTasks::*)(), DatabaseTasks*>(void (DatabaseTasks::*&&)(), DatabaseTasks*&&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #10 0x000055555561493d in void std::thread::_Invoker<std::tuple<void (DatabaseTasks::*)(), DatabaseTasks*> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #11 0x00005555556148f2 in std::thread::_Invoker<std::tuple<void (DatabaseTasks::*)(), DatabaseTasks*> >::operator()() ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #12 0x00005555556148d2 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (DatabaseTasks::*)(), DatabaseTasks*> > >::_M_run() ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #13 0x00007ffff74f2324 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #14 0x00007ffff70a27f1 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:448
2025-11-13 18:07:00 -          ret = <optimized out>
2025-11-13 18:07:00 -          pd = <optimized out>
2025-11-13 18:07:00 -          out = <optimized out>
2025-11-13 18:07:00 -          unwind_buf = {cancel_jmp_buf = {{jmp_buf = {128, -5348796068453169545, -288, 32, 0, 140737318163712, -5348796068474141065, -5348792080338270601}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
2025-11-13 18:07:00 -          not_first_call = <optimized out>
2025-11-13 18:07:00 -  #15 0x00007ffff7133b5c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
2025-11-13 18:07:00 -  No locals.
2025-11-13 18:07:00 - 
2025-11-13 18:07:00 -  Thread 3 (Thread 0x7ffff55b16c0 (LWP 737834) "tfs"):
2025-11-13 18:07:00 -  #0  __syscall_cancel_arch () at ../sysdeps/unix/sysv/linux/x86_64/syscall_cancel.S:56
2025-11-13 18:07:00 -  No locals.
2025-11-13 18:07:00 -  #1  0x00007ffff709eae3 in __internal_syscall_cancel (a1=a1@entry=93824996482052, a2=<optimized out>, a3=a3@entry=4116384416, a4=a4@entry=2553740768889401856, a5=a5@entry=0, a6=a6@entry=4294967295, nr=202) at ./nptl/cancellation.c:49
2025-11-13 18:07:00 -          result = <optimized out>
2025-11-13 18:07:00 -          pd = <optimized out>
2025-11-13 18:07:00 -          ch = <optimized out>
2025-11-13 18:07:00 -  #2  0x00007ffff709f237 in __futex_abstimed_wait_common64 (private=32767, futex_word=0x555555961c04 <g_scheduler+100>, expected=4116384416, op=8356214, abstime=0x2370b5b2f215f200, cancel=true) at ./nptl/futex-internal.c:57
2025-11-13 18:07:00 -          resultvar = <optimized out>
2025-11-13 18:07:00 -          __arg6 = <optimized out>
2025-11-13 18:07:00 -          __arg5 = <optimized out>
2025-11-13 18:07:00 -          __arg4 = <optimized out>
2025-11-13 18:07:00 -          __arg3 = <optimized out>
2025-11-13 18:07:00 -          __arg2 = <optimized out>
2025-11-13 18:07:00 -          __arg1 = <optimized out>
2025-11-13 18:07:00 -          _a6 = <optimized out>
2025-11-13 18:07:00 -          _a5 = <optimized out>
2025-11-13 18:07:00 -          _a4 = <optimized out>
2025-11-13 18:07:00 -          _a3 = <optimized out>
2025-11-13 18:07:00 -          _a2 = <optimized out>
2025-11-13 18:07:00 -          _a1 = <optimized out>
2025-11-13 18:07:00 -  #3  __futex_abstimed_wait_common (futex_word=0x555555961c04 <g_scheduler+100>, expected=4116384416, clockid=32767, abstime=0x2370b5b2f215f200, private=32767, cancel=true) at ./nptl/futex-internal.c:87
2025-11-13 18:07:00 -          err = <optimized out>
2025-11-13 18:07:00 -          clockbit = 8388096
2025-11-13 18:07:00 -          op = 8356214
2025-11-13 18:07:00 -          err = <optimized out>
2025-11-13 18:07:00 -          clockbit = <optimized out>
2025-11-13 18:07:00 -          op = <optimized out>
2025-11-13 18:07:00 -  #4  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x555555961c04 <g_scheduler+100>, expected=expected@entry=11199648, clockid=clockid@entry=0, abstime=abstime@entry=0x7ffff55b0c90, private=private@entry=0) at ./nptl/futex-internal.c:139
2025-11-13 18:07:00 -  No locals.
2025-11-13 18:07:00 -  #5  0x00007ffff70a1dca in __pthread_cond_wait_common (cond=0x555555961be0 <g_scheduler+64>, mutex=0x555555961bb8 <g_scheduler+24>, clockid=0, abstime=0x7ffff55b0c90) at ./nptl/pthread_cond_wait.c:426
2025-11-13 18:07:00 -          signals = 11199648
2025-11-13 18:07:00 -          g1_start = <optimized out>
2025-11-13 18:07:00 -          buffer = {__routine = 0x7ffff70a18b0 <__condvar_cleanup_waiting>, __arg = 0x7ffff55b0b80, __canceltype = -178582624, __prev = 0x0}
2025-11-13 18:07:00 -          cbuffer = {wseq = 22399399, cond = 0x555555961be0 <g_scheduler+64>, mutex = 0x555555961bb8 <g_scheduler+24>, private = 0}
2025-11-13 18:07:00 -          err = <optimized out>
2025-11-13 18:07:00 -          wseq = <optimized out>
2025-11-13 18:07:00 -          g = <optimized out>
2025-11-13 18:07:00 -          seq = 11199699
2025-11-13 18:07:00 -          flags = <optimized out>
2025-11-13 18:07:00 -          private = 0
2025-11-13 18:07:00 -          result = 0
2025-11-13 18:07:00 -          err = <optimized out>
2025-11-13 18:07:00 -          result = <optimized out>
2025-11-13 18:07:00 -          wseq = <optimized out>
2025-11-13 18:07:00 -          g = <optimized out>
2025-11-13 18:07:00 -          seq = <optimized out>
2025-11-13 18:07:00 -          flags = <optimized out>
2025-11-13 18:07:00 -          private = <optimized out>
2025-11-13 18:07:00 -          signals = <optimized out>
2025-11-13 18:07:00 -          g1_start = <optimized out>
2025-11-13 18:07:00 -          buffer = <optimized out>
2025-11-13 18:07:00 -          cbuffer = <optimized out>
2025-11-13 18:07:00 -  #6  ___pthread_cond_timedwait64 (cond=0x555555961be0 <g_scheduler+64>, mutex=0x555555961bb8 <g_scheduler+24>, abstime=0x7ffff55b0c90) at ./nptl/pthread_cond_wait.c:483
2025-11-13 18:07:00 -          flags = <optimized out>
2025-11-13 18:07:00 -          clockid = 0
2025-11-13 18:07:00 -  #7  0x00005555557f6a22 in __gthread_cond_timedwait(pthread_cond_t*, pthread_mutex_t*, timespec const*) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #8  0x00005555557f6a70 in std::__condvar::wait_until(std::mutex&, timespec&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #9  0x00005555557f7054 in std::cv_status std::condition_variable::__wait_until_impl<std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::unique_lock<std::mutex>&, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #10 0x00005555557f6cab in std::cv_status std::condition_variable::wait_until<std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::unique_lock<std::mutex>&, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #11 0x00005555557f6290 in Scheduler::threadMain() ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #12 0x0000555555790482 in void std::__invoke_impl<void, void (Scheduler::*)(), Scheduler*>(std::__invoke_memfun_deref, void (Scheduler::*&&)(), Scheduler*&&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #13 0x0000555555790204 in std::__invoke_result<void (Scheduler::*)(), Scheduler*>::type std::__invoke<void (Scheduler::*)(), Scheduler*>(void (Scheduler::*&&)(), Scheduler*&&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #14 0x000055555578ff09 in void std::thread::_Invoker<std::tuple<void (Scheduler::*)(), Scheduler*> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #15 0x000055555578fbfc in std::thread::_Invoker<std::tuple<void (Scheduler::*)(), Scheduler*> >::operator()() ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #16 0x000055555578f774 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (Scheduler::*)(), Scheduler*> > >::_M_run() ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #17 0x00007ffff74f2324 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #18 0x00007ffff70a27f1 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:448
2025-11-13 18:07:00 -          ret = <optimized out>
2025-11-13 18:07:00 -          pd = <optimized out>
2025-11-13 18:07:00 -          out = <optimized out>
2025-11-13 18:07:00 -          unwind_buf = {cancel_jmp_buf = {{jmp_buf = {128, -5348797155616766345, -288, 32, 0, 140737488346512, -5348797155637737865, -5348792080338270601}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
2025-11-13 18:07:00 -          not_first_call = <optimized out>
2025-11-13 18:07:00 -  #19 0x00007ffff7133b5c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
2025-11-13 18:07:00 -  No locals.
2025-11-13 18:07:00 - 
2025-11-13 18:07:00 -  Thread 2 (Thread 0x7ffff5db26c0 (LWP 737833) "tfs"):
2025-11-13 18:07:00 -  #0  0x000055555558aae8 in ItemAttributes::hasAttribute(itemAttrTypes) const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #1  0x00005555556989b4 in ItemAttributes::getExistingAttr(itemAttrTypes) const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #2  0x00005555556988c9 in ItemAttributes::getIntAttr(itemAttrTypes) const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #3  0x000055555558ab7b in Item::getIntAttr(itemAttrTypes) const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #4  0x000055555558ac2d in Item::getUniqueId() const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #5  0x00005555557136b0 in LuaScriptInterface::luaItemGetUniqueId(lua_State*) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #6  0x00007ffff7ef24c6 in ?? () from /lib/x86_64-linux-gnu/libluajit-5.1.so.2
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #7  0x00007ffff7f0ec39 in lua_pcall () from /lib/x86_64-linux-gnu/libluajit-5.1.so.2
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #8  0x00005555556a8bb1 in LuaScriptInterface::protectedCall(lua_State*, int, int) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #9  0x00005555556a9c20 in LuaScriptInterface::callFunction(int) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #10 0x0000555555728f9c in LuaEnvironment::executeTimerEvent(unsigned int) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #11 0x00005555557423c8 in void std::__invoke_impl<void, void (LuaEnvironment::*&)(unsigned int), LuaEnvironment*&, unsigned int&>(std::__invoke_memfun_deref, void (LuaEnvironment::*&)(unsigned int), LuaEnvironment*&, unsigned int&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #12 0x00005555557418a1 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&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #13 0x00005555557407e8 in void std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #14 0x000055555573ebe7 in void std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)>::operator()<, void>() ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #15 0x000055555573b2c2 in void std::__invoke_impl<void, std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)>&>(std::__invoke_other, std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)>&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #16 0x00005555557379bf in std::enable_if<std::is_void<void>::value, void>::type std::__invoke_r<void, std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)>&>(std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)>&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #17 0x000055555573300e in std::_Function_handler<void (), std::_Bind<void (LuaEnvironment::*(LuaEnvironment*, unsigned int))(unsigned int)> >::_M_invoke(std::_Any_data const&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #18 0x000055555581d064 in std::function<void ()>::operator()() const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #19 0x000055555581cfae in Task::operator()() ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #20 0x000055555581c604 in Dispatcher::threadMain() ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #21 0x0000555555790518 in void std::__invoke_impl<void, void (Dispatcher::*)(), Dispatcher*>(std::__invoke_memfun_deref, void (Dispatcher::*&&)(), Dispatcher*&&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #22 0x00005555557902a4 in std::__invoke_result<void (Dispatcher::*)(), Dispatcher*>::type std::__invoke<void (Dispatcher::*)(), Dispatcher*>(void (Dispatcher::*&&)(), Dispatcher*&&) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #23 0x000055555578ff57 in void std::thread::_Invoker<std::tuple<void (Dispatcher::*)(), Dispatcher*> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #24 0x000055555578fc1c in std::thread::_Invoker<std::tuple<void (Dispatcher::*)(), Dispatcher*> >::operator()() ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #25 0x000055555578f798 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (Dispatcher::*)(), Dispatcher*> > >::_M_run() ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #26 0x00007ffff74f2324 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #27 0x00007ffff70a27f1 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:448

And now the question is: is there any way to find out which exact Lua script caused this error?
Because I'm wandering around and searching, and I just can't find it — I thought it was this one, but knowing my luck, it probably isn't :D

LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if getPlayerStorageValue(player, 51275) == 1 then
        if getPlayerStorageValue(player, 51274) < 15 then
            setPlayerStorageValue(player, 51274, getPlayerStorageValue(player, 51274) + 1)
            doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, "[MONSTER-DAY]: Otrzymales 1 muszle. Razem posiadasz ".. getPlayerStorageValue(player, 51274) .." muszli a potrzebujesz razem 15.")
            player:say("Otrzymales 1 drewno!", TALKTYPE_MONSTER_SAY)
            doSendMagicEffect(getCreaturePosition(player), 14)
            if getPlayerStorageValue(player, 51274) == 15 then
                doSendMagicEffect(getCreaturePosition(player), 12)
                player:sendTextMessage(MESSAGE_INFO_DESCR, '[MONSTER-DAY]: Wroc do Podroznika Samapo nagrode.')
            end
            for i = 1, 2 do
                Game.createMonster(getGlobalStorageValue(BOOSTED_MONSTER), getCreaturePosition(player))
            end
            doSendMagicEffect(toPosition, 4)
            Item(item.uid):transform(3873)
            doSetItemActionId(item.uid, 100)

            
            addEvent(function()
                item:remove() -- Usunięcie aktualnego przedmiotu

                
                local newItem = Game.createItem(3871, 1, toPosition)
                if newItem then
                    newItem:setActionId(5136)
                    doSendMagicEffect(toPosition, 4) 
                end
            end, 5000) -- 12 minut
        end
    end
    return true
end

In general, this item is not supposed to disappear or be removed — the only thing that can happen is that a monster’s body or other items might end up on top of it.
 
Solution
Your engine crashed on luaItemGetUniqueId, so some addEvent used in Lua getUniqueId (or pushThing which uses getUniqueId inside). getUniqueId isn't used often, you should search in data folder for all scripts that use it and analyse, if they may be executed in addEvent somehow.

About script you posted:
LUA:
            addEvent(function()
                item:remove() -- Usunięcie aktualnego przedmiotu

               
                local newItem = Game.createItem(3871, 1, toPosition)
                if newItem then
                    newItem:setActionId(5136)
                    doSendMagicEffect(toPosition, 4)
                end
            end, 5000) -- 12 minut
This is...
The relevant parts of the stack trace is this:
Code:
2025-11-13 18:07:00 -  Thread 2 "tfs" received signal SIGSEGV, Segmentation fault.
2025-11-13 18:07:00 -  [Switching to Thread 0x7ffff5db26c0 (LWP 737833)]
2025-11-13 18:07:00 -  0x000055555558aae8 in ItemAttributes::hasAttribute(itemAttrTypes) const ()

...

2025-11-13 18:07:00 -  Thread 2 (Thread 0x7ffff5db26c0 (LWP 737833) "tfs"):
2025-11-13 18:07:00 -  #0  0x000055555558aae8 in ItemAttributes::hasAttribute(itemAttrTypes) const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #1  0x00005555556989b4 in ItemAttributes::getExistingAttr(itemAttrTypes) const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #2  0x00005555556988c9 in ItemAttributes::getIntAttr(itemAttrTypes) const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #3  0x000055555558ab7b in Item::getIntAttr(itemAttrTypes) const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #4  0x000055555558ac2d in Item::getUniqueId() const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #5  0x00005555557136b0 in LuaScriptInterface::luaItemGetUniqueId(lua_State*) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #6  0x00007ffff7ef24c6 in ?? () from /lib/x86_64-linux-gnu/libluajit-5.1.so.2
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #7  0x00007ffff7f0ec39 in lua_pcall () from /lib/x86_64-linux-gnu/libluajit-5.1.so.2
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #8  0x00005555556a8bb1 in LuaScriptInterface::protectedCall(lua_State*, int, int) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #9  0x00005555556a9c20 in LuaScriptInterface::callFunction(int) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #10 0x0000555555728f9c in LuaEnvironment::executeTimerEvent(unsigned int) ()
2025-11-13 18:07:00 -  No symbol table info available.

This shows that thread #2 was running executeTimerEvent which is used when you schedule some delayed function with addEvent. I can't tell what's going on for sure but you cannot capture those userdata objects like items and creatures into the closure (function). If for whatever reason the underlying object is deleted you'll have a dangling pointer which seems to be the problem here but I can't tell for sure.

From your example, you're doing exactly that, but it doesn't seem to be the reason for the crash this time. You'd need to have a way to reference the item either by position or uid, although I'm not exactly sure how you'd do it.
 
The relevant parts of the stack trace is this:
Code:
2025-11-13 18:07:00 -  Thread 2 "tfs" received signal SIGSEGV, Segmentation fault.
2025-11-13 18:07:00 -  [Switching to Thread 0x7ffff5db26c0 (LWP 737833)]
2025-11-13 18:07:00 -  0x000055555558aae8 in ItemAttributes::hasAttribute(itemAttrTypes) const ()

...

2025-11-13 18:07:00 -  Thread 2 (Thread 0x7ffff5db26c0 (LWP 737833) "tfs"):
2025-11-13 18:07:00 -  #0  0x000055555558aae8 in ItemAttributes::hasAttribute(itemAttrTypes) const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #1  0x00005555556989b4 in ItemAttributes::getExistingAttr(itemAttrTypes) const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #2  0x00005555556988c9 in ItemAttributes::getIntAttr(itemAttrTypes) const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #3  0x000055555558ab7b in Item::getIntAttr(itemAttrTypes) const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #4  0x000055555558ac2d in Item::getUniqueId() const ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #5  0x00005555557136b0 in LuaScriptInterface::luaItemGetUniqueId(lua_State*) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #6  0x00007ffff7ef24c6 in ?? () from /lib/x86_64-linux-gnu/libluajit-5.1.so.2
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #7  0x00007ffff7f0ec39 in lua_pcall () from /lib/x86_64-linux-gnu/libluajit-5.1.so.2
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #8  0x00005555556a8bb1 in LuaScriptInterface::protectedCall(lua_State*, int, int) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #9  0x00005555556a9c20 in LuaScriptInterface::callFunction(int) ()
2025-11-13 18:07:00 -  No symbol table info available.
2025-11-13 18:07:00 -  #10 0x0000555555728f9c in LuaEnvironment::executeTimerEvent(unsigned int) ()
2025-11-13 18:07:00 -  No symbol table info available.

This shows that thread #2 was running executeTimerEvent which is used when you schedule some delayed function with addEvent. I can't tell what's going on for sure but you cannot capture those userdata objects like items and creatures into the closure (function). If for whatever reason the underlying object is deleted you'll have a dangling pointer which seems to be the problem here but I can't tell for sure.

From your example, you're doing exactly that, but it doesn't seem to be the reason for the crash this time. You'd need to have a way to reference the item either by position or uid, although I'm not exactly sure how you'd do it.
Code:
Item(item.uid):transform(3873)
Transforming item sometimes can remove old & create new item instead forgottenserver/src/game.cpp at master · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/master/src/game.cpp#L1700)
 
Your engine crashed on luaItemGetUniqueId, so some addEvent used in Lua getUniqueId (or pushThing which uses getUniqueId inside). getUniqueId isn't used often, you should search in data folder for all scripts that use it and analyse, if they may be executed in addEvent somehow.

About script you posted:
LUA:
            addEvent(function()
                item:remove() -- Usunięcie aktualnego przedmiotu

               
                local newItem = Game.createItem(3871, 1, toPosition)
                if newItem then
                    newItem:setActionId(5136)
                    doSendMagicEffect(toPosition, 4)
                end
            end, 5000) -- 12 minut
This is like an example of code that crashes TFS 1.x. It's "Problem 2" I've described: [TFS 1.x+] How to NOT write LUA scripts or how to crash server by LUA script (https://otland.net/threads/tfs-1-x-how-to-not-write-lua-scripts-or-how-to-crash-server-by-lua-script.271018/)

If someone somehow remove that item (ex. throw it into water/dustbin), this 'addEvent' will crash. This code would be 'safe', if this item is not moveable - I still do not recommended to use it, you should fix it with position+item ID passed as parameters do addEvent.

Safe code would be:
LUA:
            addEvent(function()
                -- create Tile from position
                local tile = Tile(toPosition)
                if tile then
                    -- if tile exists, get item by ID
                    local itemToRemove = tile:getItemById(3873)
                    if itemToRemove then
                        -- if item exists, remove it
                        itemToRemove:remove()
                    end
                end

                local newItem = Game.createItem(3871, 1, toPosition)
                if newItem then
                    newItem:setActionId(5136)
                    doSendMagicEffect(toPosition, 4)
                end
            end, 5000) -- 12 minut
Passing Position object (toPosition) into addEvent is safe. That kind of 'object' is fully stored in Lua, it's not binded to any C++ object that may disappear from RAM before addEvent executes.

You can heavily reduce chance of crashes like that by moving addEvent function into local function declared above event (ex. above onUse function).
That way you see all variables passed to it - as they are function arguments now and you cannot use onUse arguments directly - and you can easier detect that you pass item, player or creature as variable used in addEvent (which may result in crash):
LUA:
local function replaceItem(position, removeItemId, createItemId, createItemActionId)
    -- create Tile from position
    local tile = Tile(position)
    if tile then
        -- if tile exists, get item by ID
        local itemToRemove = tile:getItemById(removeItemId)
        if itemToRemove then
            -- if item exists, remove it
            itemToRemove:remove()
        end
    end

    local newItem = Game.createItem(createItemId, 1, position)
    if newItem then
        newItem:setActionId(createItemActionId)
        doSendMagicEffect(position, 4)
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if getPlayerStorageValue(player, 51275) == 1 then
        if getPlayerStorageValue(player, 51274) < 15 then
            setPlayerStorageValue(player, 51274, getPlayerStorageValue(player, 51274) + 1)
            doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, "[MONSTER-DAY]: Otrzymales 1 muszle. Razem posiadasz ".. getPlayerStorageValue(player, 51274) .." muszli a potrzebujesz razem 15.")
            player:say("Otrzymales 1 drewno!", TALKTYPE_MONSTER_SAY)
            doSendMagicEffect(getCreaturePosition(player), 14)
            if getPlayerStorageValue(player, 51274) == 15 then
                doSendMagicEffect(getCreaturePosition(player), 12)
                player:sendTextMessage(MESSAGE_INFO_DESCR, '[MONSTER-DAY]: Wroc do Podroznika Samapo nagrode.')
            end
            for i = 1, 2 do
                Game.createMonster(getGlobalStorageValue(BOOSTED_MONSTER), getCreaturePosition(player))
            end
            doSendMagicEffect(toPosition, 4)
            Item(item.uid):transform(3873)
            doSetItemActionId(item.uid, 100)

            
            addEvent(replaceItem, 5000, toPosition, 3873, 3871, 5136) -- 12 minut
        end
    end
    return true
end
Just make sure that all these functions are local (as in example local function replaceItem(..), otherwise you may get other problems with OTS and scripts.
 
Solution
Hi!

About part of your onUse code: Don't rely on 'item' object in your addEvent scope. You can't be sure that same object will exist when new event scope is called. Pass UID and make sure UID is still valid.

NVM, didn't check that @Gesior.pl already replied with a full explanation.
 
Pass UID and make sure UID is still valid.
On TFS 1.x you can only pass UID of items with uniqueID set in map editor or Lua to value lower than 65536. You can't use item.uid for any item you have in Lua, like you could on TFS 0.4. TFS 0.4 kept big map of Item*<->UID in C++ part of Lua and assigned UIDs 70000+ for items without UID, when they were passed from C++ to Lua.
Passing UID (aka CID) works great for Players/Monsters/NPCs on TFS 1.x, but not for Items.

And now the question is: is there any way to find out which exact Lua script caused this error?
There is no way to find out what script crashed addEvent code. If it's a big problem on your OTS, you can save script file and line of code in addEvent object and print it into terminal before addEvent execution, so last name printed into server terminal would be addEvent that crashed, but it will spam terminal a lot.
I added addEvent file and line tracking to OTS Stats, but for CPU usage tracking, not to detect scripts that crash OTS:
 
On TFS 1.x you can only pass UID of items with uniqueID set in map editor or Lua to value lower than 65536. You can't use item.uid for any item you have in Lua, like you could on TFS 0.4. TFS 0.4 kept big map of Item*<->UID in C++ part of Lua and assigned UIDs 70000+ for items without UID, when they were passed from C++ to Lua.
Passing UID (aka CID) works great for Players/Monsters/NPCs on TFS 1.x, but not for Items.


There is no way to find out what script crashed addEvent code. If it's a big problem on your OTS, you can save script file and line of code in addEvent object and print it into terminal before addEvent execution, so last name printed into server terminal would be addEvent that crashed, but it will spam terminal a lot.
I added addEvent file and line tracking to OTS Stats, but for CPU usage tracking, not to detect scripts that crash OTS:

LUA:
data/actions/scripts/other/partyhat.lua:3:      if headSlotItem == nil or item.u                               id ~= headSlotItem:getUniqueId() then
data/actions/scripts/tools/fishing.lua:72:    if not leftHand or leftHand:getUni                               queId() ~= item:getUniqueId() then
data/movements/scripts/tiles.lua:30:                    local depotItems = playe                               r:getDepotLocker(getDepotId(depotItem:getUniqueId()), true):getItemHoldingCount(                               )
data/movements/scripts/closingdoor.lua:22:              if tileItem and tileItem                               :getUniqueId() ~= item.uid and tileItem:getType():isMovable() then
data/lib/compat/compat.lua:5:local _getUniqueId = Item.getUniqueId
data/lib/compat/compat.lua:6:function Item:getUniqueId()
data/lib/compat/compat.lua:10:    return _getUniqueId(self)
data/lib/compat/compat.lua:123:                 return methods.getUniqueId(self)
data/lib/compat/compat.lua:138:                 t.uid = thing:getUniqueId()
data/lib/compat/compat.lua:1037:        return item:getUniqueId()
data/lib/compat/compat.lua:1074:                return item:getUniqueId()
data/lib/compat/compat.lua:1082:                return item:getUniqueId()
data/spells/scripts/support/disintegrate rune.lua:11:                          i                               f item:getType():isMovable() and item:getUniqueId() > 65535 and item:getActionId                               () == 0 and not isInArray(corpseIds, item:getId()) then

These are all the scripts that use this function — and now a purely theoretical question. If I have fishing.lua, which is responsible for the fishing rod, and no player uses it, meaning the script won’t run, is it still possible for a crash to happen? Because I didn’t modify any of the other code, only the fishing rod script was edited.
 
It's always possible that the server you got has bugs in it. But the surface of item:getUniqueId() is greater than the explicit function call because compat.lua will set an __index metamethod to wire item.uid to it (depending on what version you're using ofc):

Code:
do
    local function ItemIndex(self, key)
        local methods = getmetatable(self)
        if key == "itemid" then
            return methods.getId(self)
        elseif key == "actionid" then
            return methods.getActionId(self)
        elseif key == "uid" then
            return methods.getUniqueId(self)
        elseif key == "type" then
            return methods.getSubType(self)
        end
        return methods[key]
    end
    rawgetmetatable("Item").__index = ItemIndex
    rawgetmetatable("Container").__index = ItemIndex
    rawgetmetatable("Teleport").__index = ItemIndex
end

I think the more robust solution would be to check all uses of addEvent and make sure that you don't capture userdata variables in the delayed function. You'll need to reference items by position (I'm not sure there is some other way with stock TFS) and creatures by creature id, similar to Gesior's example.
 
If I have fishing.lua, which is responsible for the fishing rod, and no player uses it, meaning the script won’t run, is it still possible for a crash to happen?
If you don't use script, it's not executed and it cannot crash server. If there is some serious bug in script, it may crash server, but on server start, when scripts are loaded.

C++:
data/lib/compat/compat.lua:5:local _getUniqueId = Item.getUniqueId
data/lib/compat/compat.lua:6:function Item:getUniqueId()
I can't find that in official 1.2. Maybe someone added in Lua some extra functions that use Item.getUniqueId.
Can you post data/lib/compat/compat.lua and data/actions/scripts/tools/fishing.lua?

But the surface of item:getUniqueId() is greater than the explicit function call because compat.lua will set an __index metamethod to wire item.uid to it (depending on what version you're using ofc):
That's another problem. Any use of .uid on item calls getUniqueId, so @Darius93 has to search for all .uid in data. Probably most will use .uid on player/monster, so there will be a lot of files to analyse :(
I would first focus on files that have getUniqueId/.uid AND addEvent. In most cases function called by addEvent is in the same file. Ex.:
Code:
grep -rlZ --include='*.lua' '\.uid' . | xargs -0 grep -l 'addEvent'
 
Last edited:
LUA:
-- Add this near the other Item methods
local _getUniqueId = Item.getUniqueId
function Item:getUniqueId()
    if not self or not self:getType() then
        return 0
    end
    return _getUniqueId(self)
end

This crash was caused by the script I posted above - I fixed it and the problem is gone :)

Thank you all for your help!
 
Your engine crashed on luaItemGetUniqueId, so some addEvent used in Lua getUniqueId (or pushThing which uses getUniqueId inside). getUniqueId isn't used often, you should search in data folder for all scripts that use it and analyse, if they may be executed in addEvent somehow.

About script you posted:
LUA:
            addEvent(function()
                item:remove() -- Usunięcie aktualnego przedmiotu

              
                local newItem = Game.createItem(3871, 1, toPosition)
                if newItem then
                    newItem:setActionId(5136)
                    doSendMagicEffect(toPosition, 4)
                end
            end, 5000) -- 12 minut
This is like an example of code that crashes TFS 1.x. It's "Problem 2" I've described: [TFS 1.x+] How to NOT write LUA scripts or how to crash server by LUA script (https://otland.net/threads/tfs-1-x-how-to-not-write-lua-scripts-or-how-to-crash-server-by-lua-script.271018/)

If someone somehow remove that item (ex. throw it into water/dustbin), this 'addEvent' will crash. This code would be 'safe', if this item is not moveable - I still do not recommended to use it, you should fix it with position+item ID passed as parameters do addEvent.

Safe code would be:
LUA:
            addEvent(function()
                -- create Tile from position
                local tile = Tile(toPosition)
                if tile then
                    -- if tile exists, get item by ID
                    local itemToRemove = tile:getItemById(3873)
                    if itemToRemove then
                        -- if item exists, remove it
                        itemToRemove:remove()
                    end
                end

                local newItem = Game.createItem(3871, 1, toPosition)
                if newItem then
                    newItem:setActionId(5136)
                    doSendMagicEffect(toPosition, 4)
                end
            end, 5000) -- 12 minut
Passing Position object (toPosition) into addEvent is safe. That kind of 'object' is fully stored in Lua, it's not binded to any C++ object that may disappear from RAM before addEvent executes.

You can heavily reduce chance of crashes like that by moving addEvent function into local function declared above event (ex. above onUse function).
That way you see all variables passed to it - as they are function arguments now and you cannot use onUse arguments directly - and you can easier detect that you pass item, player or creature as variable used in addEvent (which may result in crash):
LUA:
local function replaceItem(position, removeItemId, createItemId, createItemActionId)
    -- create Tile from position
    local tile = Tile(position)
    if tile then
        -- if tile exists, get item by ID
        local itemToRemove = tile:getItemById(removeItemId)
        if itemToRemove then
            -- if item exists, remove it
            itemToRemove:remove()
        end
    end

    local newItem = Game.createItem(createItemId, 1, position)
    if newItem then
        newItem:setActionId(createItemActionId)
        doSendMagicEffect(position, 4)
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if getPlayerStorageValue(player, 51275) == 1 then
        if getPlayerStorageValue(player, 51274) < 15 then
            setPlayerStorageValue(player, 51274, getPlayerStorageValue(player, 51274) + 1)
            doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, "[MONSTER-DAY]: Otrzymales 1 muszle. Razem posiadasz ".. getPlayerStorageValue(player, 51274) .." muszli a potrzebujesz razem 15.")
            player:say("Otrzymales 1 drewno!", TALKTYPE_MONSTER_SAY)
            doSendMagicEffect(getCreaturePosition(player), 14)
            if getPlayerStorageValue(player, 51274) == 15 then
                doSendMagicEffect(getCreaturePosition(player), 12)
                player:sendTextMessage(MESSAGE_INFO_DESCR, '[MONSTER-DAY]: Wroc do Podroznika Samapo nagrode.')
            end
            for i = 1, 2 do
                Game.createMonster(getGlobalStorageValue(BOOSTED_MONSTER), getCreaturePosition(player))
            end
            doSendMagicEffect(toPosition, 4)
            Item(item.uid):transform(3873)
            doSetItemActionId(item.uid, 100)

           
            addEvent(replaceItem, 5000, toPosition, 3873, 3871, 5136) -- 12 minut
        end
    end
    return true
end
Just make sure that all these functions are local (as in example local function replaceItem(..), otherwise you may get other problems with OTS and scripts.
Well, I put in the code you wrote and it doesn't crash anymore :D
 
Back
Top