NetBSD-Bugs archive

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

Re: bin/56538: netbsd-3 /bin/ls crashes with current libc



ctime(3) returns NULL and the printtime in the 3.0 print.c does not check for it:

Breakpoint 2, ctime (timep=0x7f7fffffe12c)
    at /usr/src/lib/libc/time/localtime.c:1913
1913    {
(gdb) print *timep
$1 = 1134943252
(gdb) fin
Run till exit from #0  ctime (timep=0x7f7fffffe12c)
    at /usr/src/lib/libc/time/localtime.c:1913
0x000000000040367b in printtime ()
Value returned is $2 = 0x7f7ff7a16e80 "Mon Dec 19 00:00:52 2005\n"
(gdb) n
Single stepping until exit from function printtime,
which has no line number information.
0x0000000000402b69 in printlong ()
(gdb) fin
Run till exit from #0  0x0000000000402b69 in printlong ()
-rw-rw-r--  1 christos  christos  26087656 Dec 19  2005 base.tgz

Breakpoint 2, ctime (timep=0x7f7fffffe12c)
    at /usr/src/lib/libc/time/localtime.c:1913
1913    {
(gdb) print *timep
$3 = 1638725229
(gdb) fin
Run till exit from #0  ctime (timep=0x7f7fffffe12c)
    at /usr/src/lib/libc/time/localtime.c:1913
0x000000000040367b in printtime ()
Value returned is $4 = 0x0
(gdb) qq
Undefined command: "qq".  Try "help".
(gdb) q
A debugging session is active.

It turns out the reason this is happening is because we
are trying to load tzfiles using a 32 bit time_t and we are
probably reading junk.

christos

Attachment: signature.asc
Description: Message signed with OpenPGP



Home | Main Index | Thread Index | Old Index