Odd crash/debug

Posted by Zeno on Sun 25 Jul 2004 02:50 AM — 1 posts, 5,049 views.

USA #0
Mstat seems to be causing crashes, so I debugged it.

(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x4207a519 in strcat () from /lib/i686/libc.so.6
(gdb) bt
#0  0x4207a519 in strcat () from /lib/i686/libc.so.6
#1  0x08361be8 in ?? ()
#2  0x0807857b in do_mstat (ch=0x8361af8, argument=0x23 <Address 0x23 out of bounds>)
    at act_wiz.c:2058
#3  0x080d5b23 in interpret (ch=0x8361af8, argument=0xbfffda06 "self") at interp.c:547
#4  0x080ab73f in game_loop () at comm.c:671
#5  0x080ab06d in main (argc=2, argv=0xbfffde20) at comm.c:304
#6  0x42015967 in __libc_start_main () from /lib/i686/libc.so.6


I tried a clean compile, a reboot, shutdown, kill PID, etc. Its not corrupt memory. What is wrong?

act_wiz.c:

    if ( IS_NPC( victim ) )
        pager_printf_color( ch, "&cAct Flags  : &w%s\n\r", ext_flag_string(&victim->act, act_flags) );
    else
    {
        pager_printf_color( ch, "&cPlayerFlags: &w%s\n\r", ext_flag_string( &victim->act, plr_flags ) );
        pager_printf_color( ch, "&cPcflags    : &w%s\n\r", flag_string( victim->pcdata->flags, pc_flags ) );


The bold line is line 2058


[EDIT] Fixed, I forgot to add a new flag in build.c, ugh, gdb wasn't that useful that time.