Paul Eggert wrote:
>
> (I built wget on Solaris 8 with GCC 3.0.3.)
>
> Here are the symptoms of the problem.
>
> 184-shade $ wget --recursive file:///
> Segmentation Fault (core dumped)
Note that file:// is not supported.
$ wget -d file://
DEBUG output created by Wget 1.8.1 on cygwin.
file://: Unsupported scheme.
But the core dump is not limited to Solaris when combining --recursive
with file://
$ wget -d --recursive file://
DEBUG output created by Wget 1.8.1 on cygwin.
Segmentation fault (core dumped)
And this is not fixed in the current CVS code
$ wget-dev -d --recursive file://
DEBUG output created by Wget 1.8.1+cvs on cygwin.
Segmentation fault (core dumped)
A patch like this (would one of the C coder on the list check it?) seems
to fix it. I suppose the FINISHED and Downloaded pat should be removed
too, to make it more clear that it ended with error.
$ ./wget-dev.exe -d --recursive file://
DEBUG output created by Wget 1.8.1+cvs on cygwin.
file://: Unsupported scheme.
FINISHED --01:12:30--
Downloaded: 0 bytes in 0 files
Index: src/recur.c
===================================================================
RCS file: /pack/anoncvs/wget/src/recur.c,v
retrieving revision 1.41
diff -u -r1.41 recur.c
--- src/recur.c 2001/12/19 14:27:29 1.41
+++ src/recur.c 2002/02/17 00:15:25
@@ -184,6 +184,7 @@
retrieve_tree (const char *start_url)
retrieve_tree (const char *start_url)
{
uerr_t status = RETROK;
+ int url_error_code; /* url parse error code */
/* The queue of URLs we need to load. */
struct url_queue *queue = url_queue_new ();
@@ -194,7 +195,14 @@
/* We'll need various components of this, so better get it over with
now. */
- struct url *start_url_parsed = url_parse (start_url, NULL);
+ struct url *start_url_parsed = url_parse (start_url,
&url_error_code);
+ if (!start_url_parsed)
+ {
+ logprintf (LOG_NOTQUIET, "%s: %s.\n", start_url, url_error
(url_error_code));
+ xfree (start_url);
+ return URLERROR;
+ }
+
/* Enqueue the starting URL. Use start_url_parsed->url rather than
just URL so we enqueue the canonical form of the URL. */
> 185-shade $ wget --version
> GNU Wget 1.8.1
>
> Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
> This program is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> GNU General Public License for more details.
>
> Originally written by Hrvoje Niksic <[EMAIL PROTECTED]>.
> 186-shade $ uname -a
> SunOS shade.twinsun.com 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-1
> 187-shade $ gdb /opt/reb/bin/wget core
> GNU gdb 5.1.1
> Copyright 2002 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 "sparc-sun-solaris2.8"...
> Core was generated by `wget --recursive file:///'.
> Program terminated with signal 11, Segmentation fault.
> Reading symbols from /usr/lib/libmd5.so.1...done.
> Loaded symbols for /usr/lib/libmd5.so.1
> Reading symbols from /opt/reb/lib/libssl.so.0.9.6...done.
> Loaded symbols for /opt/reb/lib/libssl.so.0.9.6
> Reading symbols from /opt/reb/lib/libcrypto.so.0.9.6...done.
> Loaded symbols for /opt/reb/lib/libcrypto.so.0.9.6
> Reading symbols from /usr/lib/libdl.so.1...done.
> Loaded symbols for /usr/lib/libdl.so.1
> Reading symbols from /usr/lib/libsocket.so.1...done.
> Loaded symbols for /usr/lib/libsocket.so.1
> Reading symbols from /usr/lib/libnsl.so.1...done.
> Loaded symbols for /usr/lib/libnsl.so.1
> Reading symbols from /usr/lib/libc.so.1...done.
> Loaded symbols for /usr/lib/libc.so.1
> Reading symbols from /usr/lib/libmp.so.2...done.
> Loaded symbols for /usr/lib/libmp.so.2
> Reading symbols from /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1...done.
> Loaded symbols for /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1
> #0 0x0002a698 in retrieve_tree (start_url=0x4fb98 "file:///") at recur.c:201
> 201 recur.c: No such file or directory.
> in recur.c
> (gdb) where
> #0 0x0002a698 in retrieve_tree (start_url=0x4fb98 "file:///") at recur.c:201
> #1 0x0002832c in main (argc=-4264136, argv=0xffbef054) at main.c:812
--
Med venlig hilsen / Kind regards
Hack Kampbj�rn