$ date --version
date (GNU sh-utils) 2.0
Written by David MacKenzie.
Copyright (C) 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ echo 2000-01-01 > TEST
$ date -f TEST
Sat Jan 1 00:00:00 EET 2000
Segmentation fault (core dumped)
$ gdb date core
GNU gdb 19991116
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-mandrake-linux"...
(no debugging symbols found)...
Core was generated by `date -f TEST'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
#0 0x4006caae in __libc_free (mem=0xbffffa90) at malloc.c:2956
2956 malloc.c: No such file or directory.
(gdb) bt
#0 0x4006caae in __libc_free (mem=0xbffffa90) at malloc.c:2956
#1 0x80491b9 in strcpy ()
#2 0x80495e9 in strcpy ()
#3 0x400339ee in __libc_start_main (main=0x8049208 <strcpy+1356>, argc=3,
argv=0xbffff934, init=0x80489fc, fini=0x804be14 <strcpy+12632>,
rtld_fini=0x4000a570 <_dl_fini>, stack_end=0xbffff92c)
at ../sysdeps/generic/libc-start.c:90
(gdb) quit
$ ltrace -o date.out date -f TEST
Sat Jan 1 00:00:00 EET 2000
$ cat date.out
__libc_start_main(0x08049208, 3, 0xbffff924, 0x080489fc, 0x0804be14 <unfinished ...>
__register_frame_info(0x0804f114, 0x0804f2a0, 0x400faeb8, 0x400337e0, 0x40013460) =
0x400fcc20
setlocale(6, "") = "en"
bindtextdomain("sh-utils", "/usr/share/locale") = "/usr/share/locale"
textdomain("sh-utils") = "sh-utils"
getopt_long(3, 0xbffff924, "d:f:I::r:Rs:u", 0x0804bea0, NULL) = 102
getopt_long(3, 0xbffff924, "d:f:I::r:Rs:u", 0x0804bea0, NULL) = -1
fopen("TEST", "r") = 0x08050408
__getdelim(0xbffff808, 0xbffff804, 10, 0x08050408, 1) = 11
time(NULL) = 949163196
localtime(0xbffff738) = 0x40100360
mktime(0xbffff77c, 0xbffff924, 0xbffff7bc, 0x0804aa2b, 11) = 0x386d2760
localtime(0xbffff7c8) = 0x40100360
realloc(NULL, 200) = 0x08050938
strftime("Sat Jan 1 00:00:00 EET 2000", 200, "%a %b %e %H:%M:%S %Z %Y", 0x40100360) =
28
printf("%s\n", "Sat Jan 1 00:00:00 EET 2000") = 29
free(0x08050938) = <void>
__getdelim(0xbffff808, 0xbffff804, 10, 0x08050408, 1) = -1
free(0xbffffa8a) = <void>
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
$ rpm -q glibc
glibc-2.1.2-9mdk
$ cat /etc/mandrake-release
Linux Mandrake release 7.0 (Air)
Hope that helps,
Marius Gedminas
--
A witty saying proves nothing.
-- Voltaire