cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: name lookup timed out causes application to crash (possible regression)

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sat, 20 Nov 2010 11:45:47 -0800

On Sat, Nov 20, 2010 at 10:06:27AM -0800, Adam Light wrote:
> I am using the curl_easy interface. I am *not* setting
> CURLOPT_NOSIGNAL, and I am also *not* setting any timeout options
> (such as CURLOPT_TIMEOUT). My guess is that this crash is caused by a
> signal that is emitted. I suspect that I need to set CURLOPT_NOSIGNAL
> to 1L and then configure libcurl to use c-ares. However before I do
> that I have two questions:

Either or both of this should help.

> 1. I saw in the change log for 7.21.2 that there have been some fixes
> for various timeout behavior. It's not clear to me if the crash I'm
> getting now is expected, and that previously I was just getting lucky
> and not getting a crash, or whether the crashing is a regression,
> possibly as a result of the timeout fixes.
>
> 2. The documentation for CURLOPT_NOSIGNAL says, in part:
> "This option is mainly here to allow multi-threaded unix applications
> to still set/use all timeout options etc, without risking getting
> signals. (Added in 7.10) "

That isn't quite accurate--some timeouts in some configurations are disabled
by use of CURLOPT_NOSIGNAL, but not if you're using c-ares.

> However my application is not setting any timeout options. I'm not
> sure if I'm "using" the timeout options though. So it's not clear to
> me whether I should need to set CURLOPT_NOSIGNAL if I'm not setting
> any of the timeout options.

CURLOPT_NOSIGNAL also affects reception of SIGPIPE, so you should definitely
be setting it in a multithreaded app. If you need DNS timeouts, you should
also be using c-ares or (possibly) compiling libcurl with
--enable-threaded-resolver.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-20