cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: SIGPIPE downloading with redirection

From: Lluís Batlle i Rossell <viric_at_viric.name>
Date: Sun, 6 Jan 2013 23:45:23 +0100

On Sun, Jan 06, 2013 at 11:28:59PM +0100, Daniel Stenberg wrote:
> On Sun, 6 Jan 2013, Lluís Batlle i Rossell wrote:
>
> >I get SIGPIPE in curl (so exit code 141 in linux), if I take a
> >long download with a redirection. Curl keeps the former connection
> >open, while it downloads, and at the end it tries to write
> >something to that former connection.
>
> What on earth would it try to write to it at that point? Can you
> strace it and see what the offending attempted write is?

No idea. Even using 'http' moves to 'https', and then it sends something ciphered.
'5' is the file written to disk. '3' is the first socket. Maybe SSL closing
sends something?

write(5, "g\305\264\njgs\236tk\253\363\203\351\256\216\232,\\[$\342R1F\301SC\25\3\226\256"..., 6 03) = 603
close(5) = 0
munmap(0x7f61376ca000, 4096) = 0
write(3,
"\25\3\1\0\26\244.\177\332\331;\4}U\222\305\305\7\322\360\345\350;\326\264\221\n",
27) = -1 EPIPE (Broken pipe)
--- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=6137, si_uid=1000} ---
+++ killed by SIGPIPE +++

> >I'm using curl 7.28.0, and tried it on two different gnu/linuces,
> >arm, x86_64 and i686, reproduced everywhere.
>
> You seem to have something between you and the target server that
> kills the connection after a while (5 mins?) and I don't, so when
> I've tried with curl 7.28.0 and 7.28.2-DEV
> (curl-7_28_1-129-g11f55a9) from my place nothing bad happens!

Did you try with the limit rate? A friend at the other side of the world tested
it, and got the '141' too. Notice that 'curl' did not output any string to
stdout/stderr about the SIGPIPE, so it can be seen only by the exit code.

Regards,
Lluís.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-01-06