[CODE][NEWBIE][HELP]

From: Adam Pate (apate@cesales.com)
Date: 02/18/99


First of all, I would like to apologize for sending a post earlier that was
in HTML format.  I thought I had it turned off.  . .

I am currently trying to get aliases to save.  I am using circle30bpl14
stock and Cygwin32 for the compiler.  I downloaded the alias patch (the one
from Jeremy Hess) from the circle ftp site.  I followed the directions and
made the directories for the alias files.  Compiling produced the following
errors.

make ../bin/circle
gcc -c -g -02 -wall -wno-char-subscripts  alias.c
alias.c: In function 'write_aliases'
alias.c:31 'dummy_mob' undeclared (first use this function)
alias.c: In function 'read_aliases'
alias.c:70 'dummy_mob' undeclared (first use this function)

I then greped for dummy_mob and found a define in db.h so I included it in
alias.c
It then compiled fine but now when I add an alias and try to save the alias
in game, it crashes the mud.  If any of you know how to fix this problem or
have another way of saving aliases for circle30bpl14, please let me know.  I
think it is either some compatibility issue between the alias.c code and
circle30bpl14 or including db.h in alias.c was the wrong thing to do.  Here
is some technical info on my problem for you coders out there.

In act.other.c

void write_aliases(struct char_data *ch);  <---- This is the prototype

Here is the call that I think is crashing the mud.
In function do_save,

  write_aliases(ch);            <------ This is the call to alias.c that
crashes the mud
  save_char(ch, NOWHERE);
  Crash_crashsave(ch);
  if (ROOM_FLAGGED(ch->in_room, ROOM_HOUSE_CRASH))
  House_crashsave(GET_ROOM_VNUM(IN_ROOM(ch)));

Here is the alias.c code.

void write_aliases(struct char_data *ch)
{
  FILE *file;
  char fn[127],*buf;
  struct alias *temp;
  int length;

  get_filename(GET_NAME(ch),fn,ALIAS_FILE);
  unlink(fn);
  if( !GET_ALIASES(ch) )
    return;

  file = fopen(fn,"wt");

  temp = GET_ALIASES(ch);

  while( temp )
  {
    length = strlen(temp->alias);
    fprintf(file,"%d\n",length);
    fprintf(file,"%s\n",temp->alias);
    buf = strdup(temp->replacement);
    while( *++buf == ' ' );
    length = strlen(buf);
    fprintf(file,"%d\n",length);
    fprintf(file,"%s\n",buf);
    fprintf(file,"%d\n",temp->type);
    temp = temp->next;
  }

  fclose(file);
}

And here is my core dump when the mud crashes. I really don't know if this
is useful but who knows. . . .

(bin\circle.exe 1004) Exception trapped!
(bin\circle.exe 1004) exception C0000005 at 10049FB7
(bin\circle.exe 1004) exception: ax 24DFB30 bx 2D45E48 cx 0 dx 467546
(bin\circle.exe 1004) exception: si 0 di 2CCD295 bp 24DFB0C sp 24DFB00
(bin\circle.exe 1004) exception is: STATUS_ACCESS_VIOLATION
(bin\circle.exe 1004) Stack trace:
(bin\circle.exe 1004) frame 0: sp = 0x24DF82C, pc = 0x1000A26C
(bin\circle.exe 1004) frame 1: sp = 0x24DF950, pc = 0x77F94512
(bin\circle.exe 1004) frame 2: sp = 0x24DF974, pc = 0x77F88EEB
(bin\circle.exe 1004) frame 3: sp = 0x24DFA00, pc = 0x77F76266
(bin\circle.exe 1004) frame 4: sp = 0x24DFB0C, pc = 0x10044BBC
(bin\circle.exe 1004) frame 5: sp = 0x24DFB20, pc = 0x467625
(bin\circle.exe 1004) frame 6: sp = 0x24DFBC8, pc = 0x4201FC
(bin\circle.exe 1004) frame 7: sp = 0x24DFBDC, pc = 0x44CD59
(bin\circle.exe 1004) frame 8: sp = 0x24DFC14, pc = 0x401FC6
(bin\circle.exe 1004) frame 9: sp = 0x24DFDC8, pc = 0x401621
(bin\circle.exe 1004) frame 10: sp = 0x24DFDDC, pc = 0x401501
(bin\circle.exe 1004) frame 11: sp = 0x24DFE04, pc = 0x10006B59
(bin\circle.exe 1004) frame 12: sp = 0x24DFF94, pc = 0x10006B6C
(bin\circle.exe 1004) frame 13: sp = 0x24DFFA0, pc = 0x4679AE
(bin\circle.exe 1004) frame 14: sp = 0x24DFFB0, pc = 0x40103A
(bin\circle.exe 1004) frame 15: sp = 0x24DFFC0, pc = 0x77F1B304
(bin\circle.exe 1004) End of stack trace (more stack frames may be present)


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST