Copyover Causing Seg. Fault when Loading Triggers...

From: Peter Ajamian (pajamian@access1.net)
Date: 08/11/99


I just put the (rather outdated) copyover patch into a bpl15 MUD which
is patched up with a significant number of other patches already (the
main patch concerned here is probably dg/oasis).

Anyways here is the relevent bit of code (the file is db.c, the function
is index_boot)...

  while (*buf1 != '$') {
    sprintf(buf2, "%s%s", prefix, buf1);
    if (!(db_file = fopen(buf2, "r"))) { /* <---- this is the line
causing the problem */
      log("SYSERR: %s: %s", buf2, strerror(errno));
      exit(1);
    }

When I load the core dump into gdb it shows the following...

This GDB was configured as "i386-redhat-linux"...
Core was generated by `bin/circle -q 2345'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.1...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
#0  0x4009cc61 in chunk_alloc (ar_ptr=0x4012d580, nb=184) at
malloc.c:2672
malloc.c:2672: No such file or directory.
(gdb) bt
#0  0x4009cc61 in chunk_alloc (ar_ptr=0x4012d580, nb=184) at
malloc.c:2672
#1  0x4009cb8a in __libc_malloc (bytes=176) at malloc.c:2616
#2  0x40095e5b in _IO_new_fopen (filename=0x80d30e0 "world/trg/0.trg",
mode=0x80b3123 "r")
    at iofopen.c:42
#3  0x8069cfe in index_boot (mode=6) at db.c:650
#4  0x8068fa1 in boot_world () at db.c:246
#5  0x8069132 in boot_db () at db.c:302
#6  0x8064bcc in init_game (port=2345) at comm.c:372
#7  0x8064b61 in main (argc=3, argv=0xbffffda4) at comm.c:347
#8  0x4005ccb3 in __libc_start_main (main=0x80648c0 <main>, argc=3,
argv=0xbffffda4,
    init=0x8049030 <_init>, fini=0x80a3aac <_fini>, rtld_fini=0x4000a350
<_dl_fini>,
    stack_end=0xbffffd9c) at ../sysdeps/generic/libc-start.c:78
(gdb) select-frame 3
(gdb) whatis buf2
type = char [8192]
(gdb) printf "%x %s\n", buf2, buf2
80d30e0 world/trg/0.trg

I have been racking my brains over this for for some time now, any help
anyone can give me is greatly appreciated.

Regards,


Peter


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