Segmentation Fault means the program, in this case, wget, tried to access an invalid memory address and therefore was terminated by the kernel. This typically happen due to a program bug, so while it is quite likely it is being triggered by a specific website or web page (considering you seem to be able to reproduce it quite consistently, on multiple platforms, at the same point), it is still likely you have exposed a bug in wget itself.
In order to find where in wget the segmentation fault is happening, you can use the
gdb program (GNU debugger) to get a stack trace of wget at the time it crashed, which is possible since you have a
core file. (A core dump is a copy of the image of the running program at the time it was terminated due to an invalid operation such as a Segmentation Fault.)
In order to do so, use the following command:
$ gdb wget core
Which will start the debugger on the
wget binary (from the path) and restore the
core file (in the current directory) as the image of the running program.
gdb will then print some information about the program and give you a prompt:
$ gdb wget core
GNU gdb (GDB) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
Core was generated by `wget --directory-prefix=... --recursive --page-requisites --span-hosts --tries=... --timeout=... --reject=*.tar --convert-links --adjust-extension --continue --no-check-certificate http://website.com/'.
Program terminated with signal SIGSEGV, Segmentation Fault.
At that point, you can use the command
bt (short for "backtrace") to show you what was being executed at the time the program crashed. Which is usually a good place to start looking for the bug.
For instance, you might see something like this:
#0 0x00007f5371206363 in __select_nocancel () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x0000559e5acbf21c in select_fd ()
#2 0x0000559e5acf0bde in wgnutls_poll ()
#3 0x0000559e5acbf3a2 in poll_internal ()
#4 0x0000559e5acbf6ed in fd_peek ()
#5 0x0000559e5ace423d in fd_read_hunk ()
#6 0x0000559e5acd5ef9 in gethttp ()
#7 0x0000559e5acd9b26 in http_loop ()
#8 0x0000559e5ace53c8 in retrieve_url ()
#9 0x0000559e5ace273b in retrieve_tree ()
#10 0x0000559e5acbe67d in main ()
You can then quit
gdb with the
q (for "quit") command:
It's usually helpful if you have the "debug symbols" installed. These are the information generated by the compiler for debugging binaries, which is usually stripped for binaries that are installed on a system, so they're smaller in size. That information can be saved to an alternate location (typically under
/usr/lib/debug) that can be located by
gdb while trying to debug a binary.
With that information present, your backtraces will typically have more information attached to them, such as the name of all internal functions.
On Debian, you can install the debug info for wget with the following command:
$ sudo apt-get install wget-dbgsym
You might also want to install the debug symbols for glibc:
$ sudo apt-get install libc6-amd64-dbgsym
Having said that, before you start looking at why wget crashed, you might want to try the latest version of wget, which it seems is version 1.9.4 that you can download here. That is a source package, so you might need to build from sources to get it to work in your system.
This is because a segmentation fault is typically caused by a bug, and it's quite possible this bug was already fixed in wget and the fix is present in the latest version.
In case you get the same problem in the latest version, consider getting a core file and using gdb to get a backtrace, then report the bug to wget maintainers so they have a chance to address it.
In case it's fixed on latest wget 1.9.4 but it exists in a version of Debian you are using, consider reporting this to Debian, so they can have a chance to backport the patch to their version of wget.
There's also a new project called wget2, it looks like they're trying to replace wget with a new codebase. You might want to check whether that one works or not... It seems recent Debian ship it under the name "wget2".
I hope these pointers are helpful too!