Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl

Members: 0
Guests: 5
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Bug: Switch
Forum Rules | Mark all | Recent Posts

Bug: Switch
< Newer Topic :: Older Topic > can cause crashes.

Pages:<< prev 1 next >>
Post is unread #1 Aug 5, 2006, 10:08 am
Go to the top of the page
Go to the bottom of the page

ToadVile

GroupMembers
Posts47
JoinedApr 1, 2006

Alright, i know this was talked about long time ago, but it's still around, so since it is.. i'll post a copy of the core from the crash, i don't know how it can be fixed myself..

But, you can switch into a mobile, then do a command, mud will crash.. Here is the core dump.

Core was generated by `afkmud 6500 hotboot 3 -1 -1 4'.
Program terminated with signal 11, Segmentation fault.
warning: current_sos: Can't read pathname for load map: Input/output error

Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/tls/libm.so.6...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0 0x080c4302 in colorcode (src=0x822349c "&D\n\r", dst=0xbfffb2e0 "\033[0m", d=0x0, dstlen=20, vislen=0x0)
at color.c:918
918 mudstrlcat( dst, color_str( ch->desc->pagecolor, ch ), dstlen );
Current language: auto; currently c++
(gdb) bt
#0 0x080c4302 in colorcode (src=0x822349c "&D\n\r", dst=0xbfffb2e0 "\033[0m", d=0x0, dstlen=20, vislen=0x0)
at color.c:918
#1 0x080c4ce9 in colorize (txt=0xf <Address 0xf out of bounds>, d=0x8718d08) at color.c:1330
#2 0x080c5009 in color_send_to_desc (txt=0x0, d=0x8718d08) at color.c:1441
#3 0x080c50d5 in send_to_char (txt=0x875ec40 "", ch=0x0) at color.c:1457
#4 0x0807f787 in do_look (ch=0x86abea8, argument=0x817a1f3 "\n\r";) at act_info.c:1586
#5 0x080feae0 in interpret (ch=0x86abea8, argument=0xbfffe3d4 "";) at interp.c:987
#6 0x080cce6d in game_loop () at comm.c:4263
#7 0x080cd1b5 in main (argc=7, argv=0xbfffec84) at comm.c:4773


Thats all i got, never touched color.c other then for the fix that was on the page, but thats all.
       
Post is unread #2 Aug 5, 2006, 10:53 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

Happen to have the crash file that was generated from this one? A bit more detail is needed for frames 1, 2, and 3 since I see some disturbing things, like a NULL ch that should have been caught, and NULL txt that should have been caught. If any of those are truly NULL then I would have expected the safety checks to stop it from getting as far as it did.
       
Post is unread #3 Aug 6, 2006, 6:36 pm
Go to the top of the page
Go to the bottom of the page

ToadVile

GroupMembers
Posts47
JoinedApr 1, 2006

Alright, Narrowing it down. switch don't like socials with colors, thats what causes it hehe

Here is a core dump, frame 1, 2 from the dump. (Happend when i switched into puff, did wdwon.

#0  0x080c4302 in colorcode (src=0x824393c "&D gain &YW&Rorld &YD&Romination&D today!\n\r", dst=0xbfffbbb4 "\033[0m",
    d=0x0, dstlen=20, vislen=0x0) at color.c:915
915                          mudstrlcat( dst, color_str( ch->desc->pagecolor, ch ), dstlen );
Current language:  auto; currently c++
(gdb) bt
#0  0x080c4302 in colorcode (src=0x824393c "&D gain &YW&Rorld &YD&Romination&D today!\n\r", dst=0xbfffbbb4 "\033[0m",
    d=0x0, dstlen=20, vislen=0x0) at color.c:915
#1  0x080c4ce9 in colorize (txt=0xf <Address 0xf out of bounds>, d=0x872eac8) at color.c:1327
#2  0x080c5009 in color_send_to_desc (txt=0x0, d=0x872eac8) at color.c:1438
#3  0x080c50d5 in send_to_char (txt=0x872cf88 "", ch=0x0) at color.c:1454
#4  0x080c9516 in act (AType=48,
    format=0x85c51b0 "You proclaim that you &WWILL&D gain &YW&Rorld &YD&Romination&D today!", ch=0x8704938, arg1=0x0,
    arg2=0x0, type=3) at comm.c:5179
#5  0x080fdcad in check_social (ch=0x8704938, command=0xbfffd4b8 "wdwon", argument=0xbfffdcf5 "";) at interp.c:402
#6  0x080fe984 in interpret (ch=0x8704938, argument=0xbfffdcf5 "";) at interp.c:903
#7  0x080cce6d in game_loop () at comm.c:4263
#8  0x080cd1b5 in main (argc=2, argv=0xbfffe5a4) at comm.c:4773
(gdb) frame 1
#1  0x080c4ce9 in colorize (txt=0xf <Address 0xf out of bounds>, d=0x872eac8) at color.c:1327
1327             ln = colorcode( colstr, colbuf, d, 20, NULL );
(gdb) frame 2
#2  0x080c5009 in color_send_to_desc (txt=0x0, d=0x872eac8) at color.c:1438
1438       write_to_buffer( d, colorize( txt, d ), 0 );


hope that helps out a bit :)
       
Post is unread #4 Aug 6, 2006, 6:40 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

I actually get this too. Meant to fix it, but haven't yet.

I'm pretty sure it's due to the fact it's trying to send color a mob, which shouldn't happen. Either that or it's trying to check the custom colors on the mob. Just a guess offhand.
       
Post is unread #5 Aug 6, 2006, 7:12 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,873
JoinedJul 26, 2005

You are right zeno,
in color.c function colorcode
find
            case 'D':  /* Reset to custom color for whatever is being displayed */
               if( ansi )
               {
                  /* Yes, this reset here is quite necessary to cancel out other things */
                  mudstrlcpy( dst, ANSI_RESET, dstlen );
                  if( ch )
                     mudstrlcat( dst, color_str( ch->desc->pagecolor, ch ), dstlen );
               }
               break;

change it to this
            case 'D':  /* Reset to custom color for whatever is being displayed */
               if( ansi )
               {
                  /* Yes, this reset here is quite necessary to cancel out other things */
                  mudstrlcpy( dst, ANSI_RESET, dstlen );
                  if( ch && ch->desc )
                     mudstrlcat( dst, color_str( ch->desc->pagecolor, ch ), dstlen );
               }
               break;

It seems that if your switched into a mob and its sent an &D ch is valid while ch->desc is NULL so when it trys to check it, it just crashes.
So its basically just adding an && ch->desc to the if( ch ) line
       
Post is unread #6 Aug 7, 2006, 2:04 am   Last edited Aug 7, 2006, 2:05 am by ToadVile
Go to the top of the page
Go to the bottom of the page

ToadVile

GroupMembers
Posts47
JoinedApr 1, 2006

Alright, another problem found when switched :)

If switched, you can use attrib (Which is actually dale_score), it'd crash the mud.

Here is a fix for it :)

in idale.c, in dale_score

Find:

   if( IS_IMMORTAL( ch ) )
   {
      send_to_char( "----------------------------------------------------------------------------\n\r", ch );

      ch_printf( ch, "%sIMMORTAL DATA:  Wizinvis [%s]  Wizlevel (%d)\n\r", s1,
                 IS_PLR_FLAG( ch, PLR_WIZINVIS ) ? "X" : " ", ch->pcdata->wizinvis );

and replace that with

    if( !IS_NPC(ch) && IS_IMMORTAL( ch ) )
   {
      send_to_char( "----------------------------------------------------------------------------\n\r", ch );

      ch_printf( ch, "%sIMMORTAL DATA:  Wizinvis [%s]  Wizlevel (%d)\n\r", s1,
                 IS_PLR_FLAG( ch, PLR_WIZINVIS ) ? "X" : " ", ch->pcdata->wizinvis );


That'll solve that problem for that :)
       
Pages:<< prev 1 next >>