efence locates problem in asciipfiles basecode (diskio.c)

From: Mathew Earle Reuther (graymere@zipcon.net)
Date: 10/21/02

This is my gdb output:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 31428)]
0x0809501f in fbgetline (fbfl=0x4ac91fec, line=0xbffff090 "@") at
24        for(; *r && *r != '\n' && r <= fbfl->buf + fbfl->size; r++)
(gdb) bt
#0  0x0809501f in fbgetline (fbfl=0x4ac91fec, line=0xbffff090 "@") at
#1  0x0807620b in load_char (name=0xbffff290 "ills", ch=0x4aaf1ebc) at
#2  0x0808121a in nanny (d=0x4aaf5870, arg=0xbffff580 "ills") at
#3  0x0806c5c2 in game_loop (mother_desc=5) at comm.c:753
#4  0x0806bd08 in init_game (port=7777) at comm.c:381
#5  0x0806bbfa in main (argc=1, argv=0xbffff954) at comm.c:326
#6  0x4006b336 in __libc_start_main (main=0x806b940 <main>, argc=1,
    init=0x8049334 <_init>, fini=0x80b68c0 <_fini>, rtld_fini=0x4000d2fc
    stack_end=0xbffff94c) at ../sysdeps/generic/libc-start.c:129
(gdb) l
19        char *r = fbfl->ptr, *w = line;
21        if(!fbfl || !line || !*fbfl->ptr)
22          return FALSE;
24        for(; *r && *r != '\n' && r <= fbfl->buf + fbfl->size; r++)
25          *(w++) = *r;
27        while(*r == '\r' || *r == '\n')
28          r++;
(gdb) print r
$1 = 0x4ac96000 ""
(gdb) print buf
$2 = (char (*)[0]) 0x80ce981
(gdb) print size
No symbol "size" in current context.
(gdb) print fbfl
$3 = (FBFILE *) 0x4ac91fec
(gdb) print *fbfl
$4 = {
  buf = 0x4ac95e98 "Name: Ills\nPass: IlsKDN7s6oYB.\nTitl: the
Pilferer\nSex : 1\nClas: 2\nLevl: 1\nHome: 1\nBrth: 1035216174\nPlyd:
0\nLast: 1035216174\nHite: 178\nWate: 139\nId  : 2\nAct : 128\nSkil:\n131
10\n133 5\n135 10\n138 10\n139 1"..., ptr = 0x4ac95fff "@", size = 359,
flags = 1,
  name = 0x4ac97ff0 "pfiles/i/ills"}

The code being used is circleCVS (last one before bpl22), dgscripts8,
Oasisolc current and ascii pfiles.  The versions put together were the
ones Fungi keeps updated, however, the diskio.c file is the exact same no
matter how many different versions of it I look at.

So, this issue is at the very least present as far back as day one of my
codebase that I've been struggling with.  I installed my oldest archive
(with only those components) on the linux (redhat 7.2) box that I have
access to efence on, then ran it under gdb/efence.  The above error
happened after creating an immortal, logging the immortal out and in,
creating a mortal, logging him out and back in.  Upon putting the name of
the mortal in, it rendered the error.

Now, the scope of file IO is a little bit beyond me, and the lines of code
which are giving the error, are, as I stated before, not ones I would
touch.  This would appear to me to be a nasty bug in a very widely used
pfile system.

Either that, or I suck in some way . . . always possible.

If anyone feels that this is worth looking into (since I can track it to a
point where the only code installed was relatively "stock" stuff . . .
certainly nothing others have not used over and over again), I'd greatly
appreciate it.


   | 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/25/03 PDT