cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Adam Light <aclight_at_gmail.com>
Date: Sat, 20 Nov 2010 10:06:27 -0800

Hi

I recently upgraded the libcurl version my application uses from
7.21.1 to 7.21.2. The code in my application that calls libcurl has
not changed, nor has the way I configure libcurl. After this upgrade,
I've noticed that my application crashes about 7 minutes after it
tries to fetch the contents of a url which does not exist when the
calls to libcurl were done from a preemptive thread created by my
application. The crash happens on mac osx but not windows. The stack
trace I get in the debugger when I get the crash originates in
different places but the first libcurl related call is always
create_conn(). The actual crash is always in Curl_debug. The value of
the ptr variable is "name lookup timed out".

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:

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) "

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.

Thanks for any help
Adam
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-20