Re: [CODE] Say command crashes goodies tarball?

From: Mark Garringer (zizazat@hotmail.com)
Date: 01/24/03


>Here is the output from gdb:
> > gdb bin/circle lib/core
>GNU gdb 2002-04-01-cvs
>Copyright 2002 Free Software Foundation, Inc.
>GDB is free software, covered by the GNU General Public License, and you
>are
>welcome to change it and/or distribute copies of it under certain
>conditions.
>Type "show copying" to see the conditions.
>There is absolutely no warranty for GDB.  Type "show warranty" for details.
>This GDB was configured as "i386-linux"...
>Core was generated by `./bin/circle 8001'.
>Program terminated with signal 11, Segmentation fault.
>Reading symbols from /lib/libcrypt.so.1...done.
>Loaded symbols for /lib/libcrypt.so.1
>Reading symbols from /lib/libc.so.6...done.
>Loaded symbols for /lib/libc.so.6
>Reading symbols from /lib/ld-linux.so.2...done.
>Loaded symbols for /lib/ld-linux.so.2
>Reading symbols from /lib/libnss_files.so.2...done.
>Loaded symbols for /lib/libnss_files.so.2
>#0  0x08049c12 in do_say (ch=Cannot access memory at address 0xbfff0082
>) at act.comm.c:142
>142       for (tch = world[ch->in_room].people; tch; tch =
>tch->next_in_room) {
>(gdb) bt
>#0  0x08049c12 in do_say (ch=Cannot access memory at address 0xbfff0082
>) at act.comm.c:142
>Cannot access memory at address 0xbfff007a

The supporting code of the do_say function follows:

ACMD(do_say)
{
  char ibuf[MAX_INPUT_LENGTH];
  char obuf[MAX_INPUT_LENGTH];
  char buf[MAX_INPUT_LENGTH];
  struct char_data *tch;

  skip_spaces(&argument);

  if(!*argument) {
    send_to_char(ch, "Yes, but WHAT do you want to say?\r\n");
    return;
  }

  strcpy(ibuf, argument);     /* preserve original text */

  if (!IS_NPC(ch))
    garble_text(ibuf, GET_SKILL(ch, SPEAKING(ch)), SPEAKING(ch));

  for (tch = world[ch->in_room].people; tch; tch = tch->next_in_room) {
    if (tch != ch && AWAKE(tch) && tch->desc) {
      strcpy(obuf, ibuf);     /* preserve the first garble */
      if (!IS_NPC(ch) && !IS_NPC(tch))

        garble_text(obuf, GET_SKILL(tch, SPEAKING(ch)), SPEAKING(ch));
      if (GET_SKILL(tch, SPEAKING(ch)) < 1)
       sprintf(buf, "$n says, in an unfamiliar tongue, '%s'",  obuf);
      else
       sprintf(buf, "$n says '%s'", obuf);
      act(buf, TRUE, ch, 0, tch, TO_VICT);
    }
  }

  sprintf(buf, "&cYou say, '%s&c'&n", argument);
  act(buf, TRUE, ch, 0, 0, TO_CHAR);

  /* trigger check */
  speech_mtrigger(ch, argument);
  speech_wtrigger(ch, argument);
}

As Adam said, he is the only person I am aware of that is having this
problem and I am unable to reproduce it locally. I know that he has removed
and re-run the configuration, but it doesn't seem to help.

Any help or ideas would be most welcome!

--Ziz

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/26/03 PDT