Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: fsck seg fault failure on vmware -i386?



> Can I just put the keywords (such as DBG=-g -O2) in the Makefile?
> Either in src/lib/libc/Makefile or
> in src/lib/libc/time/Makefile for instance?

Apparently the answer is YES or perhaps sometimes?

I got libc_g.a statically linked into fsck_ffs.

I was unsuccesful at statically linking gdb which was annoying...

I brought up the statically linked fsck_ffs in SU mode
and generated a coredump then brought it back into multiuser
and ran gdb on the core...
Here's what I found - makes no sense to me...looks like
timeptr got munged while being passed from inode.c to asctime.c?

maybe I really need to run gdb in SU mode...ran out of energy tonight...

Core was generated by `fsck_ffs'.
Program terminated with signal 11, Segmentation fault.
#0  _asctime_r (timeptr=0x0, buf=0x80dde00 "") at
/usr/src/lib/libc/time/asctime.c:113
113             if (timeptr->tm_wday < 0 || timeptr->tm_wday >= DAYSPERWEEK)
(gdb) bt
#0  _asctime_r (timeptr=0x0, buf=0x80dde00 "") at
/usr/src/lib/libc/time/asctime.c:113
#1  0x080733e4 in asctime (timeptr=0x0) at
/usr/src/lib/libc/time/asctime.c:154
#2  0x0804e43a in pinode (ino=224938) at /usr/src/sbin/fsck_ffs/inode.c:659
#3  0x0804def0 in clri (idesc=0xbfbfe3fc, type=0x80ccfda "UNREF", flag=1)
at /usr/src/sbin/fsck_ffs/inode.c:572
#4  0x08054ee8 in pass4 () at /usr/src/sbin/fsck_ffs/pass4.c:108
#5  0x0804f681 in checkfilesys (filesys=0xbba01040 "/dev/rwd2e",
origfs=0xbba01040 "/dev/rwd2e", child=0)
    at /usr/src/sbin/fsck_ffs/main.c:383
#6  0x0804f39d in main (argc=0, argv=0xbfbfee78) at
/usr/src/sbin/fsck_ffs/main.c:245
(gdb) list
108             register const char *   wn;
109             register const char *   mn;
110             char                    year[INT_STRLEN_MAXIMUM(int) + 2];
111             char                    result[MAX_ASCTIME_BUF_SIZE];
112
113             if (timeptr->tm_wday < 0 || timeptr->tm_wday >= DAYSPERWEEK)
114                     wn = "???";
115             else    wn = wday_name[timeptr->tm_wday];
116             if (timeptr->tm_mon < 0 || timeptr->tm_mon >= MONSPERYEAR)
117                     mn = "???";
(gdb) print timeptr->tm_wday
Cannot access memory at address 0x18
(gdb) up
#1  0x080733e4 in asctime (timeptr=0x0) at
/usr/src/lib/libc/time/asctime.c:154
154             return asctime_r(timeptr, buf_asctime);
(gdb) list
149
150     char *
151     asctime(timeptr)
152     register const struct tm *      timeptr;
153     {
154             return asctime_r(timeptr, buf_asctime);
155     }
(gdb) print timeptr
$1 = (const struct tm *) 0x0
(gdb) up
#2  0x0804e43a in pinode (ino=224938) at /usr/src/sbin/fsck_ffs/inode.c:659
659             p = ctime(&t);
(gdb) list
654             printf("MODE=%o\n", iswap16(DIP(dp, mode)));
655             if (preen)
656                     printf("%s: ", cdevname());
657             printf("SIZE=%llu ", (unsigned long long)iswap64(DIP(dp,
size)));
658             t = iswap32(DIP(dp, mtime));
659             p = ctime(&t);
660             printf("MTIME=%12.12s %4.4s ", &p[4], &p[20]);
661     }
662
663     void
(gdb) print t
$2 = 1264115119
(gdb) print &t
$3 = (time_t *) 0xbfbfe360
(gdb)




Home | Main Index | Thread Index | Old Index