• 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 0.X Unexpected Crash

potinho

Advanced OT User
Joined
Oct 11, 2009
Messages
1,403
Solutions
17
Reaction score
151
Location
Brazil
Hello guys, everything good?

My server has had no crash problems for over a year, but today I had one and I am not able to interpret the generated GDB. Could you help me to fix it?

C++:
#6  ServiceManager::run (this=0x7fff81299fd0) at server.cpp:249
        it = {px = 0x5599ac4a6310, pn = {pi_ = 0x5599ac4a6670}}
        threads = std::vector of length 1, capacity 1 = {{px = 0x5599ac4a6310, pn = {pi_ = 0x5599ac4a6670}}}
        __PRETTY_FUNCTION__ = "void ServiceManager::run()"
#7  0x00005599ab04e150 in main (argc=<optimized out>, argv=<optimized out>) at otserv.cpp:360
        args = std::vector of length 1, capacity 1 = {"./extremeot"}
        servicer = {<boost::noncopyable_::noncopyable> = {<No data fields>}, _vptr.ServiceManager = 0x5599ab4ff580 <vtable for ServiceManager+16>, m_io_service = {<boost::asio::detail::noncopyable> = {<No data fields>},
            service_registry_ = 0x5599ac4a5b10, impl_ = @0x5599ac4a5b60},
          deathTimer = {<boost::asio::basic_io_object<boost::asio::deadline_timer_service<boost::posix_time::ptime, boost::asio::time_traits<boost::posix_time::ptime> >, false>> = {service = @0x5599ac4a5c40,
              implementation = {<boost::asio::detail::noncopyable> = {<No data fields>},
                expiry = {<boost::date_time::base_time<boost::posix_time::ptime, boost::date_time::counted_time_system<boost::date_time::counted_time_rep<boost::posix_time::millisec_posix_time_system_config> > >> = {<boost::operators_impl::less_than_comparable<boost::posix_time::ptime, boost::operators_impl::equality_comparable<boost::posix_time::ptime, boost::posix_time::ptime, boost::operators_impl::operators_detail::empty_base<boost::posix_time::ptime>, boost::operators_impl::operators_detail::false_t>, boost::operators_impl::operators_detail::empty_base<boost::posix_time::ptime>, boost::operators_impl::operators_detail::true_t>> = {<boost::operators_impl::less_than_comparable1<boost::posix_time::ptime, boost::operators_impl::equality_comparable<boost::posix_time::ptime, boost::posix_time::ptime, boost::operators_impl::operators_detail::empty_base<boost::posix_time::ptime>, boost::operators_impl::operators_detail::false_t> >> = {<boost::operators_impl::equality_comparable<boost::posix_time::ptime, boost::posix_time::ptime, boost::operators_impl::operators_detail::empty_base<boost::posix_time::ptime>, boost::operators_impl::operators_detail::false_t>> = {<boost::operators_impl::equality_comparable1<boost::posix_time::ptime, boost::operators_impl::operators_detail::empty_base<boost::posix_time::ptime> >> = {<boost::operators_impl::operators_detail::empty_base<boost::posix_time::ptime>> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, time_ = {time_count_ = {value_ = 9223372036854775806}}}, <No data fields>}, might_have_pending_waits = false, timer_data = {
                  op_queue_ = {<boost::asio::detail::noncopyable> = {<No data fields>}, front_ = 0x0, back_ = 0x0}, heap_index_ = 8, next_ = 0x0, prev_ = 0x0}}}, <No data fields>}, running = true,
          m_acceptors = std::map with 2 elements = {[7171] = {px = 0x7fb534b6e490, pn = {pi_ = 0x7fb535fb2aa0}}, [7172] = {px = 0x7fb534b6e870, pn = {pi_ = 0x7fb5362aa8e0}}}}
        sigh = {__sigaction_handler = {sa_handler = 0x1, sa_sigaction = 0x1}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x9fc000000001}
        __func__ = "main"

Thread 4 (Thread 0x7fb550d65700 (LWP 7952)):
#0  0x00007fb556494d50 in __GI___nanosleep (requested_time=requested_time@entry=0x7fb550d64c90, remaining=remaining@entry=0x7fb550d64c90) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
        resultvar = 18446744073709551100
        sc_cancel_oldtype = 0
        sc_ret = <optimized out>
---Type <return> to continue, or q <return> to quit---
#1  0x00005599ab2240e7 in std::this_thread::sleep_for<long, std::ratio<1l, 1000l> > (__rtime=...) at /usr/include/c++/7/thread:373
        __s = <optimized out>
        __ns = <optimized out>
        __ts = {tv_sec = 0, tv_nsec = 4386338}
        __s = <optimized out>
        __ns = <optimized out>
        __ts = <optimized out>
#2  Stats::threadMain (this=<optimized out>) at stats.cpp:82
        special_stats = empty std::forward_list
        tasks = std::vector of length 3, capacity 4 = {std::forward_list = {[0] = 0x7fb53593f6a0, [1] = 0x7fb534cf24c0, [2] = 0x7fb54a8df690, [3] = 0x7fb5365a65b0, [4] = 0x7fb500be2c00, [5] = 0x7fb53578f5c0, [6] = 0x7fb52c21b250,
            [7] = 0x7fb5353de6a0, [8] = 0x7fb535282d90, [9] = 0x7fb5002b6350, [10] = 0x7fb54a65bd70, [11] = 0x7fb519bc1b30, [12] = 0x7fb5194d2770, [13] = 0x7fb5353d6630, [14] = 0x7fb519765ee0, [15] = 0x7fb514240200,
            [16] = 0x7fb534d01680, [17] = 0x7fb534dc46a0, [18] = 0x7fb5348e2cd0, [19] = 0x7fb53527d670, [20] = 0x7fb4e0027250, [21] = 0x7fb535a8a8a0, [22] = 0x7fb4e005c6e0, [23] = 0x7fb4e0013240, [24] = 0x7fb519b57290,
            [25] = 0x7fb4e0015b50, [26] = 0x7fb4e0014b00, [27] = 0x7fb4e0065950, [28] = 0x7fb5353cef30, [29] = 0x7fb4e0027470, [30] = 0x7fb4e00658d0, [31] = 0x7fb4e005ca50, [32] = 0x7fb4e00131c0, [33] = 0x7fb534cbe2c0,
            [34] = 0x7fb519c280f0, [35] = 0x7fb4e005cb10, [36] = 0x7fb4e002a480, [37] = 0x7fb4e002ac60, [38] = 0x7fb535879fd0, [39] = 0x7fb535404920, [40] = 0x7fb5198600d0, [41] = 0x7fb4e00784a0, [42] = 0x7fb4e0016090,
            [43] = 0x7fb4e005c090, [44] = 0x7fb535105590, [45] = 0x7fb4e0015aa0, [46] = 0x7fb4e005c5b0, [47] = 0x7fb4e0012f10, [48] = 0x7fb4e005ccf0, [49] = 0x7fb54a651d40, [50] = 0x7fb519e7cc70, [51] = 0x7fb5199297f0,
            [52] = 0x7fb53564cf70, [53] = 0x7fb519cc74d0, [54] = 0x7fb519a53d90, [55] = 0x7fb54a745190, [56] = 0x7fb52ebb3180, [57] = 0x7fb54a75d5e0, [58] = 0x7fb4e0015890, [59] = 0x7fb4e0028bd0, [60] = 0x7fb4e005c1c0,
            [61] = 0x7fb4e00292c0, [62] = 0x7fb4e0014a80, [63] = 0x7fb4e0053780, [64] = 0x7fb4e0053890, [65] = 0x7fb50e7c3dc0, [66] = 0x7fb519815b90, [67] = 0x7fb4e00663b0, [68] = 0x7fb4e005bfe0, [69] = 0x7fb53553f570,
            [70] = 0x7fb534d8be00, [71] = 0x7fb534eaafe0, [72] = 0x7fb519aae3d0, [73] = 0x7fb4e00799d0, [74] = 0x7fb4e0011240, [75] = 0x7fb4e00149d0, [76] = 0x7fb4e003b060, [77] = 0x7fb4e00792c0, [78] = 0x7fb4e0079340,
            [79] = 0x7fb4e0027f90, [80] = 0x7fb4e002a7b0, [81] = 0x7fb53542c760, [82] = 0x7fb4e0012d00, [83] = 0x7fb535847170, [84] = 0x7fb535557560, [85] = 0x7fb4e0066ca0, [86] = 0x7fb4e0053a40}, empty std::forward_list,
          empty std::forward_list}
        lua_stats = std::forward_list = {[0] = 0x7fb5354db120, [1] = 0x7fb5354c20b0, [2] = 0x7fb519ca5e30, [3] = 0x7fb536fe3cb0, [4] = 0x7fb5356eb320, [5] = 0x7fb519dfff10, [6] = 0x7fb531717790, [7] = 0x7fb53508a850,
          [8] = 0x7fb53574a100, [9] = 0x7fb534d87b90, [10] = 0x7fb51a1bb070, [11] = 0x7fb5356306a0, [12] = 0x7fb5352f3b80, [13] = 0x7fb53566e990, [14] = 0x7fb534c6c8a0, [15] = 0x7fb5356210d0, [16] = 0x7fb5358ee0d0,
          [17] = 0x7fb54a312600, [18] = 0x7fb54a363510, [19] = 0x7fb5357e4250, [20] = 0x7fb5357ed040, [21] = 0x7fb519a94570, [22] = 0x7fb5034c4bd0, [23] = 0x7fb53599e240, [24] = 0x7fb519aeb740, [25] = 0x7fb535404ee0,
          [26] = 0x7fb5366c27a0, [27] = 0x7fb535e21940, [28] = 0x7fb5356b3f50, [29] = 0x7fb535162850, [30] = 0x7fb54a883cd0, [31] = 0x7fb5348cfda0, [32] = 0x7fb549ea67f0}
        sql_stats = empty std::forward_list
        threadId = 0
        taskLockUnique = <optimized out>
        last_iteration = <optimized out>

Thread 2 (Thread 0x7fb551d67700 (LWP 7950)):
#0  Items::operator[] (id=<optimized out>, this=0x5599ab50ea20 <Item::items>) at items.h:277
No locals.
#1  Item::hasProperty (this=0x7fb51e94d4c0, prop=prop@entry=BLOCKPROJECTILE) at item.cpp:715
        it = <optimized out>
#2  0x00005599ab2415b0 in Tile::hasProperty (this=0x7fb51e94d510, prop=prop@entry=BLOCKPROJECTILE) at tile.cpp:45
No locals.
#3  0x00005599ab17cbf0 in Map::checkSightLine (this=this@entry=0x7fb54a24eea0, fromPos=..., toPos=...) at map.cpp:507
        move_hor = <optimized out>
        move_ver = <optimized out>
        move_cross = <optimized out>
        tile = <optimized out>
        start = {x = <optimized out>, y = <optimized out>, z = 6}
        destination = <optimized out>
        mx = -1 '\377'
        my = 1 '\001'
        A = 2
        B = <optimized out>
        C = -3009
#4  0x00005599ab17cd46 in Map::isSightClear (this=0x7fb54a24eea0, fromPos=..., toPos=..., floorCheck=floorCheck@entry=true) at map.cpp:529
No locals.
#5  0x00005599ab0cce2f in Game::isSightClear (this=<optimized out>, fromPos=..., toPos=..., floorCheck=floorCheck@entry=true) at game.cpp:4195
No locals.
#6  0x00005599ab0a665a in Creature::onAttacking (this=this@entry=0x7fb5359a2e10, interval=interval@entry=100) at creature.cpp:251
        deny = <optimized out>
        attackEvents = empty std::__cxx11::list
#7  0x00005599ab183c20 in Monster::onAttacking (this=0x7fb5359a2e10, interval=100) at monster.cpp:663
No locals.
#8  0x00005599ab0dac27 in Game::checkCreatures (this=0x5599ab510b60 <g_game>) at game.cpp:4391
        i = 0
        __func__ = "checkCreatures"
        it = 0x7fb5359a2e10
        creatureVector = std::vector of length 38, capacity 38 = {0x7fb535c3a980, 0x7fb535cbd770, 0x7fb535fa4610, 0x7fb535fd0d00, 0x7fb5363fb940, 0x7fb536296520, 0x7fb5365e0390, 0x7fb5361eddc0, 0x7fb536706d50, 0x7fb5368eddd0,
          0x7fb536749210, 0x7fb53696f5d0, 0x7fb537410ba0, 0x7fb537423ce0, 0x7fb5374191c0, 0x7fb5370e2790, 0x7fb5341fd830, 0x7fb53420c580, 0x7fb53742dec0, 0x7fb53742e800, 0x7fb53743aee0, 0x7fb5341fe920, 0x7fb534211b20, 0x7fb5341e8660,
          0x7fb53420dc70, 0x7fb5341c5dd0, 0x7fb534202e10, 0x7fb534202290, 0x7fb534215460, 0x7fb53741bb60, 0x7fb5374183e0, 0x7fb54a857fa0, 0x7fb537417160, 0x7fb534e41ca0, 0x7fb536898ea0, 0x7fb5359a2e10, 0x7fb53499ca70, 0x7fb53499e770}
        checkCreatureVector = <optimized out>
#9  0x00005599ab0c3dc8 in std::function<void ()>::operator()() const (this=0x7fb549c9d2a8) at /usr/include/c++/7/bits/std_function.h:706
No locals.
#10 Task::operator() (this=0x7fb549c9d250) at dispatcher.h:42
No locals.
#11 Dispatcher::threadMain (this=0x5599ab511960 <g_dispatcher>) at dispatcher.cpp:74
        task = 0x7fb549c9d250
        __for_range = <optimized out>
        __for_begin = <optimized out>
---Type <return> to continue, or q <return> to quit---
        __for_end = <optimized out>
        tmpTaskList = std::vector of length 1, capacity 512 = {0x7fb549c9d250}
        taskLockUnique = {_M_device = 0x5599ab511970 <g_dispatcher+16>, _M_owns = false}
        time_point = {__d = {__r = 1692748795558565155}}
        outputPool = <optimized out>
#12 0x00007fb555b756df in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#13 0x00007fb55648a6db in start_thread (arg=0x7fb551d67700) at pthread_create.c:463
        pd = 0x7fb551d67700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140416738817792, 8840955436444649515, 140416738815936, 0, 94118508912000, 140735360376464, -8801228239351085013, -8801213784928319445}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0,
              0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#14 0x00007fb55523261f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
No locals.
#6  Scheduler::threadMain (this=0x5599ab511840 <g_scheduler>) at scheduler.cpp:44
        task = 0x7fb5351b1f30
        it = <optimized out>
        ret = <optimized out>
        eventLockUnique = {_M_device = 0x5599ab511858 <g_scheduler+24>, _M_owns = true}
#7  0x00007fb555b756df in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#8  0x00007fb55648a6db in start_thread (arg=0x7fb551566700) at pthread_create.c:463
        pd = 0x7fb551566700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140416730425088, 8840955436444649515, 140416730423232, 0, 94118508912368, 140735360376464, -8801229337252100053, -8801213784928319445}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0,
              0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#9  0x00007fb55523261f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
No locals.

Complete log attached.
 

Attachments

why don't you just change to tfs 1.x insteqad of try to fix this neverending buggy otx2
Too many custom things, money spent on this engine, 4 years working on this. Worked perfectly over then an year without crash, i believe there's just few things to make it perfect
 
Last edited:
Too many custom things, money spent on this engine, 4 years working on this. Worked perfectly over then an year without crash, i believe there's just few things to make it perfect
I worked on the engine otx xd, I gave up, but I like your conviction that you continue with it, I hope you can solve it
 
I'd tell it's some concurrent acces to std::_Hashtable.

Title suggests it's a TFS 0.x. I noticed Scheduler::threadMain() in backtrace.
It looks like something added at the time of TFS ~1.2


If it's such skeleton mix of tfs 0.4 & 1.x I'd advise you to go through all changes since then and apply these fixes too:

There were few important fixes since then (including some major rework)
Make sure to not only check changes in scheduller.cpp ;) look for tasks.cpp and others too.

Most likely these are changes you're looking for but you'd need to apply all previous changes (just a guess):

As things were re-organized look for changes in:
  • tasks.cpp
  • scheduler.cpp
 
Last edited:
Back
Top