[Code] Strange error.

From: Jeremy Maloney (riodan@cyberspace.org)
Date: 01/09/03


Hello folks, I'm in mid swing on installing and converting the
guild-improved.tar.gz system into a patch level 17. Through it all, I've
managed to get it to compile without complaint, but I'm experiencing a
strange crash bug. Mortals who do the commands don't crash us, but
Immortals who do it, crash us hard. Here's an example of the code.

ACMD(do_allguilds)
{
  struct guild_data *g;
  int i, num;

  *buf = '\0';
  for (i = 1; i <= MAX_GUILD_TYPES; i++) {

   g = guilds_data;
   sprintf(buf, "%s\r\n      &c%s list&n\r\n", buf, guild_types[i]);
   sprintf(buf, "%s      &R=====", buf);

   for (num = 1; num <= strlen(guild_types[i]); num++)
     sprintf(buf, "%s=", buf);

   sprintf(buf, "%s&n\r\n\r\n", buf);
   while (g) {
    if (GLD_TYPE(g) == i)
     sprintf(buf, "%s%s  [%d] [%s]\r\n", buf, g->name, g->idnum,
             (GLD_FLAGGED(g, GLD_IC) ? "IC" : "OOC"));
     g = g->next;
   }

  }

  sprintf(buf, "%s\r\n\r\n", buf);
  page_string(ch->desc,buf,1);

}

Here's the general gdb message on doing a gdb bin/circle lib/core:

Reading symbols from /lib/ld-linux.so.2...done.
#0  0x80bc716 in page_string (d=0x816fc08,
    str=0x811a000 "\r\n      &cTribe list&n\r\n
&R==========&n\r\n\r\n\r\n      &cOrganization list&n\r\n      &R", '='
<repeats 17 times>, "&n\r\n\r\n\r\n\r\n", keep_internal=1) at modify.c:444
444       lines = MAX(GET_LINES(d->character), 10);

Here's info local:

(gdb) info local
d = (struct descriptor_data *) 0x816fc08
str = 0x811a000 "\r\n      &cTribe list&n\r\n
&R==========&n\r\n\r\n\r\n      &cOrganization list&n\r\n      &R", '='
<repeats 17 times>, "&n\r\n\r\n\r\n\r\n"
keep_internal = 1
lines = 0

and last but not least, here's modify.c line 444:

 lines = MAX(GET_LINES(d->character), 10);

I can't for the life of me figure out why it's crashing.
Anyone have a clue?

--
   +---------------------------------------------------------------+
   | 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