WEIRD buffer/score bug

Posted by Marowi on Sat 06 Mar 2004 05:38 PM — 9 posts, 30,335 views.

#0
I was messing around with removing/changing languages - EXACTLY to how some other post here suggested. Anyway, now the third time I type 'score', it crashes. I was getting really frustrated thinking that it was the languages so I restored a backup and did it again.. a few times.

I noticed that the second time I typed 'score', it displayed the last line of text from the room in it.. like so.

"Score for Marowi: The UnknownThe Monitoring Terminal has been installed here.."
"Score for Marowi: The UnknownA message disk has been discarded here.."

Also, if I save, and then type 'score'

"Score for Marowi: The Unknown(null)."

I kept logging on and typing it twice, and doing other stuff, and seeing what would happen the third time. Anyway, I noticed I had a grenade in my inventory, got annoyed, armed it and this came up:

"Log: [*****] BUG: Freeing null pointer
You arm a grenade."

I then threw it, let it blow up, typed 'score' once more, and it crashed. So, I loaded it back up again, but the problem remains. I've also just noticed that if I type 'score' twice in quick succession the same thing happens.

I'll give gdb a quick go, but PLEASE help if you can.
#1
GDB run, here goes:

Program received signal SIGSEGV, Segmentation fault.
0x610cbd11 in strlen () from /home/Marowi/toth/area/cygwin1.dll

Then I did a backtrace and got:

#0 0x610cbd11 in strlen () from /home/Marowi/toth/area/cygwin1.dll

#1 0x610cfadc in wmemset () from /home/Marowi/toth/area/cygwin1.dll

#2 0x610e089e in wmemset ()
from /home/Marowi/toth/area/cygwin1.dll

#3 0x61086211 in ?? ()
in cygwin1!aclcheck () from /home/Marowi/toth/area/cygwin1.dll

#4 0x004d407f in ?? ()

#5 0x0a0c8258 in ?? ()

#6 0x004d34e2 in ?? ()

#7 0x0a0c8b88 in ?? ()

#8 0x00000005 in ?? ()

#9 0x004d5423 in ?? ()

#10 0x004d34e2 in ?? ()

#11 0x00000058 in ?? ()

Now, I have no idea what anything said above means at all, but I'm hoping that you guys have an idea.
#2
I just restored from a backup before I had even touched the languages, or anything in fact. The same problem occurs, I just hadn't realised it because i'd barely used 'score' until I started using it to check out the languages I put in.

AAARGGH!

Marowi
#3
Ok, I am about to demonstrate my inability to read after having not slept in nearly 3 days.

In function 'do_score' in player.c, this is what it read:
ch_printf(ch, "\n\rScore for %s.\n\r", ch->pcdata->title);

As most of you can see, there are two variables called, and only one response. (If you can't see that, come and sit in the corner with me.)

Sorry to waste anyone's time who even read this post.
Canada #4
if this is SWR, then yes, there are indeed two %s in it, what a horroble, horrible bug to be left in. It is usually the very first thing fixed, heh.
USA #5
Is this because there is a %s lurking in ch->pcdata->title? What an evil way to do things...
Canada #6
No, stock SWR usually looks like:

    set_char_color(AT_SCORE, ch);

    ch_printf(ch, "\n\rScore for %s%s.\n\r", ch->pcdata->title);
    set_char_color(AT_SCORE, ch);

USA #7
Hah, yeah. I remember that one. It comes with all SWR 1.0 stock distributions. Easily fixed though. I'd still start from SWR 1.0 FUSS, I've found it much much better then stock SWR 1.0.
USA #8
Quote:

No, stock SWR usually looks like:

set_char_color(AT_SCORE, ch);

ch_printf(ch, "\n\rScore for %s%s.\n\r", ch->pcdata->title);
set_char_color(AT_SCORE, ch);

might be stock code and all but someone took out the ch->name before the ch->pcdata->title that was in there