Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 33833

Summary: wget 1.9.x core dumps when used with proxy
Product: Gentoo Linux Reporter: Jeld The Dark Elf <jeld>
Component: Current packagesAssignee: Greg Fitzgerald (RETIRED) <gregf>
Status: RESOLVED DUPLICATE    
Severity: critical CC: eckert.thomas, gentoo, mholzer, seemant, tseng
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Jeld The Dark Elf 2003-11-19 08:04:19 UTC
When using wget 1.9x with *_proxy environment variables set, wget coredumps.
If I get some spare time I will try to debug.

Reproducible: Always
Steps to Reproduce:
1. emerge wget
2. export http_proxy="ftp://myproxy:21/"
3. wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.0-test9.tar.bz2

Actual Results:  
wget dumps core on a segfault

Expected Results:  
obviously it is supposed to download the file

I am marking this critical, since wget is used by portage (by default) to
retrieve source archives. If version 1.9 gets onto the CD, this is going to be a
pain for a lot of people.
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2003-11-19 11:14:38 UTC
i don't have any problems with latest squid proxy
Comment 2 Jeld The Dark Elf 2003-11-19 12:08:57 UTC
I get coredumps on both http: and ftp: URLs 
with version 1.9.1-r1 compiled with nls and ssl.
Here is a sample output:
wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.0-test9.tar.bz2
--15:06:52--  ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.0-test9.tar.bz2
           => `linux-2.6.0-test9.tar.bz2'
Aborted (core dumped)
Comment 3 Jeld The Dark Elf 2003-11-19 12:10:43 UTC
Here is strace output:
execve("/usr/bin/wget", ["wget", "ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.0-test9.tar.bz2"], [/* 47 vars */]) = 0
uname({sys="Linux", node="raistlin", ...}) = 0
brk(0)                                  = 0x807c000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40015000
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=96159, ...}) = 0
mmap2(NULL, 96159, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40016000
close(3)                                = 0
open("/usr/lib/libssl.so.0.9.7", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \205\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0555, st_size=216792, ...}) = 0
mmap2(NULL, 187152, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4002e000
mmap2(0x40059000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2b) = 0x40059000
close(3)                                = 0
open("/usr/lib/libcrypto.so.0.9.7", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\277\2"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0555, st_size=1198133, ...}) = 0
mmap2(NULL, 1035096, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4005c000
mmap2(0x40144000, 73728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xe7) = 0x40144000
mmap2(0x40156000, 11096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40156000
close(3)                                = 0
mprotect(0xbffff000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC|0x1000000) = 0
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0f\33\0\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=13415, ...}) = 0
mmap2(NULL, 12088, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40159000
mmap2(0x4015b000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1) = 0x4015b000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0Q[\1\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1483713, ...}) = 0
mmap2(NULL, 1249028, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4015c000
mmap2(0x40287000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x12a) = 0x40287000
mmap2(0x4028b000, 7940, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4028b000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4028d000
munmap(0x40016000, 96159)               = 0
brk(0)                                  = 0x807c000
brk(0x809d000)                          = 0x809d000
brk(0)                                  = 0x809d000
access("/etc/wget/wgetrc", F_OK)        = 0
open("/etc/wget/wgetrc", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=4021, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000
read(3, "###\n### Sample Wget initializati"..., 4096) = 4021
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40016000, 4096)                = 0
access("/root/.wgetrc", F_OK)           = -1 ENOENT (No such file or directory)
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, TIOCGWINSZ, {ws_row=42, ws_col=120, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
rt_sigaction(SIGHUP, {SIG_IGN}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGHUP, {0x8060c8a, [HUP], SA_RESTORER|SA_RESTART, 0x40185928}, {SIG_IGN}, 8) = 0
rt_sigaction(SIGUSR1, {0x8060c8a, [USR1], SA_RESTORER|SA_RESTART, 0x40185928}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGWINCH, {0x806279d, [WINCH], SA_RESTORER|SA_RESTART, 0x40185928}, {SIG_DFL}, 8) = 0
getuid32()                              = 0
geteuid32()                             = 0
getgid32()                              = 0
getegid32()                             = 0
getuid32()                              = 0
geteuid32()                             = 0
getgid32()                              = 0
getegid32()                             = 0
stat64("/root/.rnd", {st_mode=S_IFREG|0600, st_size=1024, ...}) = 0
open("/root/.rnd", O_RDONLY)            = 3
fstat64(3, {st_mode=S_IFREG|0600, st_size=1024, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000
read(3, "gkj?\207A\370\r\360R\3574\314\3\372\360N\215\261\303\357"..., 4096) = 1024
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40016000, 4096)                = 0
getpid()                                = 22481
getpid()                                = 22481
open("/dev/urandom", O_RDONLY|O_NONBLOCK|O_NOCTTY) = 3
select(4, [3], NULL, NULL, {0, 10000})  = 1 (in [3], left {0, 10000})
read(3, "0\340\350\322\323\303!\30|\257e\373\212B\224xUL\22\177"..., 32) = 32
close(3)                                = 0
getpid()                                = 22481
getpid()                                = 22481
getuid32()                              = 0
getpid()                                = 22481
time(NULL)                              = 1069272581
getpid()                                = 22481
access("linux-2.6.0-test9.tar.bz2", F_OK) = -1 ENOENT (No such file or directory)
time(NULL)                              = 1069272581
open("/etc/localtime", O_RDONLY)        = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1267, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000
read(3, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\4\0"..., 4096) = 1267
close(3)                                = 0
munmap(0x40016000, 4096)                = 0
write(2, "--15:09:41--  ftp://ftp.kernel.o"..., 125--15:09:41--  ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.0-test9.tar.bz2
           => `linux-2.6.0-test9.tar.bz2'
) = 125
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
getpid()                                = 22481
kill(22481, SIGABRT)                    = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT +++
Comment 4 Seemant Kulleen (RETIRED) gentoo-dev 2003-11-19 12:13:33 UTC
trinity sephora $ export http_proxy="localhost:3128"                          ~
trinity sephora $ wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.0-test9.tar.bz2
--12:13:16--  ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.0-test9.tar.bz2
           => `linux-2.6.0-test9.tar.bz2'
Resolving ftp.kernel.org... 204.152.189.116
Connecting to ftp.kernel.org[204.152.189.116]:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/linux/kernel/v2.6 ... done.
==> PORT ... done.    ==> RETR linux-2.6.0-test9.tar.bz2 ... done.
Length: 33,226,512 (unauthoritative)

 1% [                                     ] 561,992      389.77K/s             
Comment 5 Seemant Kulleen (RETIRED) gentoo-dev 2003-11-19 12:14:09 UTC
worked for me there with wget-1.9.1-r1 and the latest squid.  Not sure why you have your issue.
Comment 6 Jeld The Dark Elf 2003-11-19 12:19:31 UTC
Here I have squid 2.5 stable 3 and a separate FTP proxy ( not sure which one )
Comment 7 Jeld The Dark Elf 2003-11-19 12:21:59 UTC
Now, do not be silly, you define an http proxy and do an ftp download, of course it is going to work since it will not use the proxy. Also, I have an actual remote system running the proxy, not localhost.
Comment 8 Brandon Hale (RETIRED) gentoo-dev 2003-11-19 12:25:12 UTC
same here, working w/ squid. maybe your proxy server is doing something nasty
Comment 9 Brandon Hale (RETIRED) gentoo-dev 2003-11-19 12:32:24 UTC
btw, squid works fine as an ftp proxy as well, so set http_proxy="ftp://myproxy:3128/" and you're off
Comment 10 Jeld The Dark Elf 2003-11-19 12:34:43 UTC
Every other program seems to work. I just made an experiment, and replaced proxy IP address with the DNS name. It works with the name, but coredumps with an IP.
Wierd!
Comment 11 Greg Fitzgerald (RETIRED) gentoo-dev 2003-11-19 15:00:12 UTC
Since this dies only when using an IP address its a duplicate of bug #33827

*** This bug has been marked as a duplicate of 33827 ***
Comment 12 Martin Holzer (RETIRED) gentoo-dev 2003-11-20 10:26:31 UTC
this is very unusual http_proxy="ftp://myproxy:3128/

i used
http_proxy="http://myproxy:3128/