cURL / Mailing Lists / curl-library / Single Mail


Re: Program received signal SIGPIPE, Broken pipe.

From: Daniel Stenberg <>
Date: Mon, 3 Jun 2013 22:31:26 +0200 (CEST)

On Fri, 31 May 2013, Indtiny s wrote:

> I am running a one application which starts the timer thread for some
> internal purpose .
> when I ever that timer expires I do some actions and send the results to
> server so I use curl to post the result to the server with https (using
> openssl ) .
> When Iever curl perform the easy_perform , I receive the SIgnal *Program
> received signal SIGPIPE, Broken pipe*. in the gdb .
> Though I set the option *curl_easy_setopt(session, CURLOPT_NOSIGNAL, 1L);*
> I am getting the same issue , is it a problem at curl or my application .?

The reason for the problem is that CURLOPT_NOSIGNAL, 1L makes libcur not
attempt to do anything with signals, and OpenSSL can in some cases attempt to
write() to closed connections and thus generate a SIGPIPE.

First step toward a fix: please try out and give me your comments on my
suggested patch for this issue that I've posted previously here:

The patch isn't (yet) covering all the cases but I'm considering to proceed
nevertheless. I also consider doing the sigaction-magic conditional to only
get done if libcurl is built with libraries for which it makes sense. Such as

As a work-around until we have that fix merged into libcurl, you can do that
sigpipe-ignoring yourself in your app.

List admin:
Received on 2013-06-03