• 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++ Crash Bug

Fortera Global

Intermediate OT User
Joined
Nov 20, 2015
Messages
1,180
Solutions
2
Reaction score
117
I dont know how its happens yet, but we have a log:

C++:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x633175d38700 (LWP 27841)]
operator<< <char, std::char_traits<char>, std::allocator<char> > (__str=<error reading variable: Cannot access memory at address 0x7272616d202d205a>,
    __os=...) at /usr/include/c++/4.8/bits/basic_string.h:2758
2758          return __ostream_insert(__os, __str.data(), __str.size());
(gdb) bt full
#0  operator<< <char, std::char_traits<char>, std::allocator<char> > (__str=<error reading variable: Cannot access memory at address 0x7272616d202d205a>,
    __os=...) at /usr/include/c++/4.8/bits/basic_string.h:2758
No locals.
#1  Player::getDescription (this=0x633113073600, lookDistance=1) at player.cpp:319
        memberCount = <optimized out>
        s = <incomplete type>
#2  0x00000000004d0521 in LuaScriptInterface::luaCreatureGetDescription (L=0x40000378) at luascript.cpp:7502
        distance = 1
        creature = <optimized out>
#3  0x0000633177bb5a9b in ?? () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
No symbol table info available.
#4  0x0000633177bf8d00 in lua_pcall () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
No symbol table info available.
#5  0x0000000000525693 in protectedCall (nresults=0, nargs=4, L=0x40000378) at luascript.cpp:299
        error_index = 4
        ret = <optimized out>
#6  LuaScriptInterface::callVoidFunction (this=this@entry=0x25f8d00, params=params@entry=4) at luascript.cpp:556
        size = 8
#7  0x000000000045c3c1 in Events::eventPlayerOnLook (this=0x25f8d00, player=player@entry=0x6330ed672100, position=..., thing=thing@entry=0x633113073600,
    stackpos=stackpos@entry=1 '\001', lookDistance=1) at events.cpp:413
No locals.
#8  0x000000000047a038 in Game::playerLookAt (this=<optimized out>, playerId=<optimized out>, pos=..., stackPos=<optimized out>) at game.cpp:3204
        thingPos = {x = 33275, y = 32390, z = 8 '\b'}
        playerPos = <optimized out>
        lookDistance = <optimized out>
        player = 0x6330ed672100
        thing = 0x633113073600
#9  0x00000000005ba628 in operator() (this=0x6330472eef80) at /usr/include/c++/4.8/functional:2471
No locals.
#10 operator() (this=0x6330472eef70) at tasks.h:42
No locals.
#11 Dispatcher::threadMain (this=0x856cc0 <g_dispatcher>) at tasks.cpp:50
        task = 0x6330472eef70
        taskLockUnique = {_M_device = 0x856cd8 <g_dispatcher+24>, _M_owns = false}
#12 0x0000633176d5da60 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
No symbol table info available.
#13 0x0000633175d94184 in start_thread (arg=0x633175d38700) at pthread_create.c:312
        __res = <optimized out>
        pd = 0x633175d38700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {109064081344256, -6976274802886025917, 1, 0, 109064081344960, 109064081344256, 6434976058805083459,
                6434976145403436355}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#14 0x00006331764c4ffd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
hastebin

someone know why its happens? tfs 1.2

thanks
 
what would be the right command in gdb?

p (Player*)0x6330ed672100

print $1*name

player name, right?

how to use 0x633113073600?

p (Player*)0x633113073600

print $2*(?????)
 
Seems like it tried to create std::string from invalid data in getDescription method. I'd suggest to add some security checks there
 
Back
Top