Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, DotBot, Yandex

Members: 0
Guests: 5
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Switch and color
Forum Rules | Mark all | Recent Posts

Switch and color
< Newer Topic :: Older Topic > Crashing is bad, mmkay

Pages:<< prev 1 next >>
Post is unread #1 Feb 4, 2003, 2:41 pm
Go to the top of the page
Go to the bottom of the page

Aynber
New Member
GroupMembers
Posts7
JoinedFeb 4, 2003

I've recently joined a mud as a coder, so am unsure of what has been added before I came on board. They already had a list of bugs that needed to be fixed (of course!). One of them is the switch command. An imm can switch into a mob just fine, but the moment a command is tried (or the imm starts beating down the mob you just switched into), the mud crashes. Score is the only command I've gotten to work.

We're running Smaug 1.4a. When I ran gdb, I got the following:


Program received signal SIGSEGV, Segmentation fault.
0x080a1887 in make_color_sequence (col=0x813d4b2 "&D\n\r\n\r", code=0xbfff7c10 "\e[0m", d=0x85377c0) at comm.c:3554
3554 strcat( code, color_str( ch->desc->pagecolor, ch ) );

It seems to be coming from the ANSI code for reset (The &D and the "\e[0m";), but I'm unsure how to fix this.

The code around the line of the error is:
case 'D': /* Reset to custom color for whatever is being displayed */
strcpy( code, ANSI_RESET ); /* Yes, this reset here is quite necessary to cancel out other things */
strcat( code, color_str( ch->desc->pagecolor, ch ) );
break;


If anyone could shed some light on this for me, I'd be grateful. :)
       
Post is unread #2 Mar 18, 2003, 10:14 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

That code you have listed there with ANSI_RESET looks like someone installed either my color system or Sadiq's patches for ANSI handling. In either case, it would be of more benifit to see a backtrace of the crash so we can see where it was going and how it got to where it crashed. It's probably got something to do with the ch->desc part and the fact that you're switched. Might very well have been a bugfix to how that's handled that was missed along the way that needs to be ferreted back out into the open.

BTW - sorry for the rather late nature of this reply, but I hadn't noticed the post before now :P
       
Post is unread #3 Mar 19, 2003, 8:38 am
Go to the top of the page
Go to the bottom of the page

Aynber
New Member
GroupMembers
Posts7
JoinedFeb 4, 2003

Thanks for the reply. I've done the backtrace about 3 different times with different commands. I've listed all 3 below (sorry for the massive amounts, but I was trying to make sure it was the same thing each time). The first ones were done a month ago, the last one was done today.

Program received signal SIGSEGV, Segmentation fault.
0x080a1a97 in make_color_sequence (col=0xbfffc3e0 "&D&w Aynber stands here\n\r", code=0xbfffb360 "\e[0m", d=0x855b8c8)
at comm.c:3554
3554 strcat( code, color_str( ch->desc->pagecolor, ch ) );
(gdb) bt

#0 0x080a1a97 in make_color_sequence (col=0xbfffc3e0 "&D&w Aynber stands here\n\r", code=0xbfffb360 "\e[0m", d=0x855b8c8)
at comm.c:3554
#1 0x0809f51b in send_to_char_color (txt=0xbfffc3d0 "&w(&PSwitched&w)&D&w Aynber stands here\n\r", ch=0x84c0f98)
at comm.c:2470
#2 0x0809f46c in send_to_char (txt=0xbfffc3d0 "&w(&PSwitched&w)&D&w Aynber stands here\n\r", ch=0x84c0f98) at comm.c:2441
#3 0x08051e60 in show_char_to_char_0 (victim=0x8538770, ch=0x84c0f98) at act_info.c:767
#4 0x080522e1 in show_char_to_char (list=0x84c0f98, ch=0x84c0f98) at act_info.c:899
#5 0x08052827 in do_look (ch=0x84c0f98, argument=0xbffff901 "";) at act_info.c:1040
#6 0x080ce8fc in interpret (ch=0x84c0f98, argument=0xbffff901 "";) at interp.c:737
#7 0x0809be38 in game_loop () at comm.c:660
#8 0x0809b6df in main (argc=2, argv=0xbffffe34) at comm.c:307
#9 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6


Program received signal SIGSEGV, Segmentation fault.
0x080a1a97 in make_color_sequence (col=0xbfff9d05 "&D\n\r", code=0xbfff9c80 "\e[0m", d=0x8539818) at comm.c:3554
3554 strcat( code, color_str( ch->desc->pagecolor, ch ) );

(gdb) where
#0 0x080a1a97 in make_color_sequence (col=0xbfff9d05 "&D\n\r", code=0xbfff9c80 "\e[0m", d=0x8539818) at comm.c:3554
#1 0x0809f51b in send_to_char_color (txt=0xbfff9cf0 "&WYou chat '&wtest&W'&D\n\r", ch=0x84c1518) at comm.c:2470
#2 0x0809f46c in send_to_char (txt=0xbfff9cf0 "&WYou chat '&wtest&W'&D\n\r", ch=0x84c1518) at comm.c:2441
#3 0x0809fa6b in ch_printf (ch=0x84c1518, fmt=0x8137a5c "&WYou %s '&w%s&W'&D\n\r";) at comm.c:2637
#4 0x0804a029 in talk_channel (ch=0x84c1518, argument=0xbffff625 "test", channel=2, verb=0x818feaf "chat";) at act_comm.c:462
#5 0x0804a87c in do_chat (ch=0x84c1518, argument=0xbffff625 "test";) at act_comm.c:692
#6 0x080ce8fc in interpret (ch=0x84c1518, argument=0xbffff625 "test";) at interp.c:737
#7 0x0809be38 in game_loop () at comm.c:660
#8 0x0809b6df in main (argc=2, argv=0xbffffb54) at comm.c:307
#9 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6
(gdb) bt
#0 0x080a1a97 in make_color_sequence (col=0xbfff9d05 "&D\n\r", code=0xbfff9c80 "\e[0m", d=0x8539818) at comm.c:3554
#1 0x0809f51b in send_to_char_color (txt=0xbfff9cf0 "&WYou chat '&wtest&W'&D\n\r", ch=0x84c1518) at comm.c:2470
#2 0x0809f46c in send_to_char (txt=0xbfff9cf0 "&WYou chat '&wtest&W'&D\n\r", ch=0x84c1518) at comm.c:2441
#3 0x0809fa6b in ch_printf (ch=0x84c1518, fmt=0x8137a5c "&WYou %s '&w%s&W'&D\n\r";) at comm.c:2637
#4 0x0804a029 in talk_channel (ch=0x84c1518, argument=0xbffff625 "test", channel=2, verb=0x818feaf "chat";) at act_comm.c:462
#5 0x0804a87c in do_chat (ch=0x84c1518, argument=0xbffff625 "test";) at act_comm.c:692
#6 0x080ce8fc in interpret (ch=0x84c1518, argument=0xbffff625 "test";) at interp.c:737
#7 0x0809be38 in game_loop () at comm.c:660
#8 0x0809b6df in main (argc=2, argv=0xbffffb54) at comm.c:307
#9 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6


Program received signal SIGSEGV, Segmentation fault.
0x080a1b23 in make_color_sequence (col=0x81a8459 "&D\n\r", code=0xbfffc610 "\e[0m", d=0x8623fc0) at comm.c:3581
3581 strcat( code, color_str( ch->desc->pagecolor, ch ) );
(gdb) bt
#0 0x080a1b23 in make_color_sequence (col=0x81a8459 "&D\n\r", code=0xbfffc610 "\e[0m", d=0x8623fc0) at comm.c:3581
#1 0x0809f5a7 in send_to_char_color (txt=0x81a8440 "&RThat really did &PHURT!&D\n\r", ch=0x855cab8) at comm.c:2497
#2 0x080a05c4 in act (AType=1034, format=0x81654be "&RThat really did &PHURT!&D", ch=0x855cab8, arg1=0x0, arg2=0x0, type=3)
at comm.c:3003
#3 0x080bb01e in damage (ch=0x855e098, victim=0x855cab8, dam=19, dt=1000) at fight.c:2335
#4 0x080b9000 in one_hit (ch=0x855e098, victim=0x855cab8, dt=1000) at fight.c:1346
#5 0x080b7d27 in multi_hit (ch=0x855e098, victim=0x855cab8, dt=-1) at fight.c:829
#6 0x080b6ea8 in violence_update () at fight.c:404
#7 0x0812dbc9 in update_handler () at update.c:2038
#8 0x0809bef2 in game_loop () at comm.c:680
#9 0x0809b76b in main (argc=2, argv=0xbffffe34) at comm.c:307
#10 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6
       
Post is unread #4 Mar 19, 2003, 9:52 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Ok. That narrows it down considerably. The problem is definitely in make_color_sequence, and it appears as though it's descriptor related since it's crashing on the line referencing it. While in gdb on frame 0, what does "print ch->desc" and "print ch->desc->pagecolor" produce? I'm suspecting you'll get either a 0x0 or a "cannot access memory" type of message from it. Either case will indicate something hosed the descriptor pointer for ch while switched.

I'd suggest grabbing my color code, which this patch you've applied is based on, and simply installing that according to it's directions. First though I'd reverse the instructions found in the colorize parser patch on my site.

If that's not an option, we'll need to dig deeper to find a cause for this. Tracking back to problems with switch isn't easy and often leads to great frustration.
       
Post is unread #5 Mar 23, 2003, 3:44 pm
Go to the top of the page
Go to the bottom of the page

Aynber
New Member
GroupMembers
Posts7
JoinedFeb 4, 2003

So far, it seems to be working. Thank you very much!
       
Pages:<< prev 1 next >>