[Bug 3229] [regression, patch] 1.18.x wget breaks with script-generated output due to not considering errno=EAGAIN

bugzilla at busybox.net bugzilla at busybox.net
Fri Feb 11 20:14:02 UTC 2011


https://bugs.busybox.net/show_bug.cgi?id=3229

--- Comment #2 from Denys Vlasenko <vda.linux at googlemail.com>  ---
EINTR is no longer possible since progress meter does not use signals anymore.
Therefore fgets/fread wrappers will be deleted in the next release.

I don't understand under what conditions EAGAIN is a problem.

Here is a test script I use:

file=debian-31r0a-i386-binary-1.iso
>$file
dd bs=1M count=639 </dev/zero >$file
strace -tt -oLOG ./busybox wget -c
ftp://ftp.uar.net/pub/Linuxes/debian3.1/$file

And in the LOG, I see:

21:10:17.232823 poll([{fd=6, events=POLLIN|POLLPRI, revents=POLLIN}], 1, 1000)
= 1
21:10:17.234052 read(6,
"\216\177\231\241\6H>tp\3713\177D.\37\237\313csy|.O\315"..., 65536) = 1452
21:10:17.234123 read(6, 0x8110e1c, 61440) = -1 EAGAIN (Resource temporarily
unavailable)
21:10:17.234172 write(3,
"\216\177\231\241\6H>tp\3713\177D.\37\237\313csy|.O\315"..., 1452) = 1452
21:10:17.234224 clock_gettime(0x1 /* CLOCK_??? */, {2322, 135332047}) = 0
21:10:17.234265 poll([{fd=6, events=POLLIN|POLLPRI, revents=POLLIN}], 1, 1000)
= 1
21:10:17.235794 read(6,
"\344\2677\303\344\30\20\317u\256\344%\344\331\222\333\310"..., 65536) = 1452
21:10:17.235865 read(6, 0x8110e1c, 61440) = -1 EAGAIN (Resource temporarily
unavailable)
21:10:17.235907 write(3,
"\344\2677\303\344\30\20\317u\256\344%\344\331\222\333\310"..., 1452) = 1452
21:10:17.235960 clock_gettime(0x1 /* CLOCK_??? */, {2322, 137068378}) = 0
21:10:17.236002 poll([{fd=6, events=POLLIN|POLLPRI, revents=POLLIN}], 1, 1000)
= 1
21:10:17.237424 read(6,
"\272\237\237\323uw\345\375\232*_\357\361/\27z\354\257\374"..., 65536) = 1452
21:10:17.237495 read(6, 0x8110e1c, 61440) = -1 EAGAIN (Resource temporarily
unavailable)
21:10:17.237537 write(3,
"\272\237\237\323uw\345\375\232*_\357\361/\27z\354\257\374"..., 1452) = 1452
21:10:17.237615 clock_gettime(0x1 /* CLOCK_??? */, {2322, 138722873}) = 0

As you see, EAGAIN does happen, but it doesn't break download. It merely makes
fread(buf, 1, size, fp) return with partial read (instead of blocking). I
tested glibc and uclibc and both work fine.


Can you show your strace log of the bug in action?

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list