I just compiled wget 1.7 under HP-UX and discovered that it dumps core
on -every- invocation, whether with no args, a single arg of --help or
--version, or a URL.  1.6 appears to do the same thing.  1.5.3 (the
version I've been using up until now), and every previous version of
wget I've ever used, doesn't do this.  I have not changed anything
about my compiler or anything else since building 1.5.3.

Some simple debugging with gdb led me to discover that my copy of
/usr/local/etc/wgetrc is actually a directory, which contained a file
called sample.wgetrc.  I have no idea if this was the way things used
to work under earlier wget releases, or if I was just trying to put
the sample file somewhere I'd remember it later when I first set this
up years ago, but versions of wget before 1.6 were at least
well-behaved enough to ignore this.  (I don't use a global init
anyway.)  1.6 and 1.7, on the other hand, explode and dump core
without giving the user a clue what might be wrong.  The code that
parses this init file (and the other places where they might hang out)
should (a) warn if the file isn't an ordinary file or a link, but is
instead anything else (a directory, something weirder...), and (b)
should not blow up if the file's contents are peculiar (e.g., binary).

System information, in case it has any relevance:

% uname -a
HP-UX oob B.10.20 A 9000/725 unknown

The failure (in 1.7; 1.6 is similar except for line number):

% wget --version
utils.c:906: failed assertion `length > 0'
Abort (core dumped)

% gdb wget
GDB is free software and you are welcome to 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.
GDB 4.16 (hppa1.1-hp-hpux9.05), Copyright 1996 Free Software Foundation, Inc...
(gdb) run
Starting program: /a/usr/local/src/wget-1.7-virgin/src/wget 
warning: Unable to find __d_pid symbol in object file.
warning: Suggest linking with /usr/lib/end.o.
warning: GDB will be unable to track shl_load/shl_unload calls
utils.c:906: failed assertion `length > 0'

Program received signal SIGABRT, Aborted.
0x7aff9b30 in kill ()
(gdb) bt
#0  0x7aff9b30 in kill ()
#1  0x7af6030c in _raise ()
#2  0x7af40be8 in _abort ()
#3  0x27b64 in __eprintf (string=0x7b037054 "", expression=0x1 "", line=1058, 
    filename=0x7ae9f720 "z�\002�z��@z�+\200z��@z�\177hz��@z�\177�z��@{\003V\210")
#4  0x25cbc in read_whole_line (fp=0x7aea7c60) at utils.c:906
#5  0x1b640 in run_wgetrc (file=0x6aec "/usr/local/etc/wgetrc") at init.c:355
#6  0x1b72c in initialize () at init.c:394
(gdb) quit
The program is running.  Quit anyway (and kill it)? (y or n) y
%

Configure and make:

% ./configure
creating cache ./config.cache
configuring for GNU Wget 1.7
checking host system type... hppa1.1-hp-hpux10.20
checking whether make sets ${MAKE}... yes
checking for a BSD compatible install... /usr/local/bin/install -c
checking build system type... hppa1.1-hp-hpux10.20
checking for ranlib... ranlib
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for ld used by GCC... /bin/ld
checking if the linker (/bin/ld) is GNU ld... no
checking for BSD-compatible nm... /usr/local/bin/nm -B
checking whether ln -s works... yes
updating cache ./config.cache
loading cache ./config.cache within ltconfig
checking for object suffix... o
checking for executable suffix... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.lo... yes
checking if gcc supports -fno-rtti -fno-exceptions ... no
checking if gcc static flag -static works... -static
checking if the linker (/bin/ld) is GNU ld... no
checking whether the linker (/bin/ld) supports shared libraries... yes
checking command to parse /usr/local/bin/nm -B output... ok
checking how to hardcode library paths into programs... relink
checking for /bin/ld option to reload object files... -r
checking dynamic linker characteristics... hpux10.20 dld.sl
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for objdir... .libs
creating libtool
updating cache ./config.cache
loading cache ./config.cache
checking for gcc... (cached) gcc
checking whether the C compiler (gcc -g -O2 ) works... yes
checking whether the C compiler (gcc -g -O2 ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for AIX... no
checking for gcc option to accept ANSI C... 
checking for function prototypes... yes
checking for working const... yes
checking for inline... inline
checking for size_t... yes
checking for pid_t... yes
checking whether byte ordering is bigendian... yes
checking size of long... 4
checking size of long long... 8
checking for string.h... yes
checking for stdarg.h... yes
checking for unistd.h... yes
checking for sys/time.h... yes
checking for utime.h... yes
checking for sys/utime.h... no
checking for sys/select.h... no
checking for sys/utsname.h... yes
checking for pwd.h... yes
checking for signal.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking return type of signal handlers... void
checking for struct utimbuf... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... no
checking for strdup... yes
checking for strstr... yes
checking for strcasecmp... yes
checking for strncasecmp... yes
checking for gettimeofday... yes
checking for mktime... yes
checking for strptime... yes
checking for strerror... yes
checking for snprintf... yes
checking for vsnprintf... yes
checking for select... yes
checking for signal... yes
checking for symlink... yes
checking for access... yes
checking for isatty... yes
checking for uname... yes
checking for gethostname... yes
checking for gethostbyname... yes
checking for socket in -lsocket... no
checking for runtime libraries flag... "-R"
checking whether NLS is requested... yes
language catalogs: cs da de el es et fr gl hr it ja nl no pl pt_BR ru sk sl sv tr zh_TW
checking for msgfmt... msgfmt
checking for xgettext... :
checking for gmsgfmt... msgfmt
checking for locale.h... yes
checking for libintl.h... no
checking for gettext... no
checking for gettext in -lintl... no
gettext not found; disabling NLS
checking for makeinfo... makeinfo
checking for perl5... /usr/local/bin/perl5
checking for pod2man... no
updating cache ./config.cache
creating ./config.status
creating Makefile
creating src/Makefile
creating doc/Makefile
creating util/Makefile
creating po/Makefile.in
creating windows/Makefile
creating src/config.h
generating po/POTFILES from ./po/POTFILES.in
creating po/Makefile
% make
echo timestamp > stamp-h.in
cd src && make CC='gcc' CPPFLAGS='' DEFS='-DHAVE_CONFIG_H 
-DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" -DLOCALEDIR=\"/usr/local/share/locale\"' 
CFLAGS='-g -O2' LDFLAGS='' LIBS='' prefix='/usr/local' exec_prefix='/usr/local' 
bindir='/usr/local/bin' infodir='/usr/local/info' mandir='/usr/local/man' manext='1'
make[1]: Entering directory `/a/usr/local/src/wget-1.7-virgin/src'
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c cmpt.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c connect.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c cookies.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c fnmatch.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c ftp.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c ftp-basic.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c ftp-ls.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c ftp-opie.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c getopt.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c hash.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c headers.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c host.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c html-parse.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c html-url.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c http.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c init.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c log.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c main.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c md5.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c netrc.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c rbuf.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c recur.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c retr.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c snprintf.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c url.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c utils.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c version.c
gcc -I. -I.    -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" 
-DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c safe-ctype.c
/bin/sh ../libtool gcc -g -O2  -o wget  cmpt.o connect.o cookies.o fnmatch.o ftp.o 
ftp-basic.o ftp-ls.o ftp-opie.o getopt.o hash.o headers.o host.o html-parse.o 
html-url.o http.o init.o log.o main.o md5.o netrc.o rbuf.o recur.o retr.o snprintf.o  
url.o utils.o version.o safe-ctype.o 
mkdir .libs
gcc -g -O2 -o wget cmpt.o connect.o cookies.o fnmatch.o ftp.o ftp-basic.o ftp-ls.o 
ftp-opie.o getopt.o hash.o headers.o host.o html-parse.o html-url.o http.o init.o 
log.o main.o md5.o netrc.o rbuf.o recur.o retr.o snprintf.o url.o utils.o version.o 
safe-ctype.o
make[1]: Leaving directory `/a/usr/local/src/wget-1.7-virgin/src'
cd doc && make CC='gcc' CPPFLAGS='' DEFS='-DHAVE_CONFIG_H 
-DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" -DLOCALEDIR=\"/usr/local/share/locale\"' 
CFLAGS='-g -O2' LDFLAGS='' LIBS='' prefix='/usr/local' exec_prefix='/usr/local' 
bindir='/usr/local/bin' infodir='/usr/local/info' mandir='/usr/local/man' manext='1'
make[1]: Entering directory `/a/usr/local/src/wget-1.7-virgin/doc'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/a/usr/local/src/wget-1.7-virgin/doc'
cd po && make CC='gcc' CPPFLAGS='' DEFS='-DHAVE_CONFIG_H 
-DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" -DLOCALEDIR=\"/usr/local/share/locale\"' 
CFLAGS='-g -O2' LDFLAGS='' LIBS='' prefix='/usr/local' exec_prefix='/usr/local' 
bindir='/usr/local/bin' infodir='/usr/local/info' mandir='/usr/local/man' manext='1'
make[1]: Entering directory `/a/usr/local/src/wget-1.7-virgin/po'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/a/usr/local/src/wget-1.7-virgin/po'
cd util && make CC='gcc' CPPFLAGS='' DEFS='-DHAVE_CONFIG_H 
-DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" -DLOCALEDIR=\"/usr/local/share/locale\"' 
CFLAGS='-g -O2' LDFLAGS='' LIBS='' prefix='/usr/local' exec_prefix='/usr/local' 
bindir='/usr/local/bin' infodir='/usr/local/info' mandir='/usr/local/man' manext='1'
make[1]: Entering directory `/a/usr/local/src/wget-1.7-virgin/util'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/a/usr/local/src/wget-1.7-virgin/util'
cd windows && make CC='gcc' CPPFLAGS='' DEFS='-DHAVE_CONFIG_H 
-DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" -DLOCALEDIR=\"/usr/local/share/locale\"' 
CFLAGS='-g -O2' LDFLAGS='' LIBS='' prefix='/usr/local' exec_prefix='/usr/local' 
bindir='/usr/local/bin' infodir='/usr/local/info' mandir='/usr/local/man' manext='1'
make[1]: Entering directory `/a/usr/local/src/wget-1.7-virgin/windows'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/a/usr/local/src/wget-1.7-virgin/windows'
% 

[END]

Reply via email to