cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl library bug

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 23 Jun 2010 23:41:24 -0700

On Wed, Jun 23, 2010 at 10:20:17PM -0800, Viktor Molnar wrote:
> Thank you for your reply.
> I know about the possible segfaults, but if you try my example
> from my original message, you will see the problem. This segfault
> is rised when timeout is reached. That's why is timeout set to 1 in
> my example from original message. In example, http://www.alza.sk is used,
> because on this site, timeout is reached. To be more specific about the
> segfault, here is gdb output:
>
> Core was generated by `./a.out'.
> Program terminated with signal 11, Segmentation fault.
> #0 0xb7745c79 in addbyter () from /usr/lib/libcurl.so.4
> (gdb) where
> #0 0xb7745c79 in addbyter () from /usr/lib/libcurl.so.4
> #1 0xb7746eff in dprintf_formatf () from /usr/lib/libcurl.so.4
> #2 0xb7747760 in curl_mvsnprintf () from /usr/lib/libcurl.so.4
> #3 0xb7745e02 in curl_msnprintf () from /usr/lib/libcurl.so.4
> #4 0xb7734e66 in Curl_failf () from /usr/lib/libcurl.so.4
> #5 0xb772a5f4 in Curl_resolv_timeout () from /usr/lib/libcurl.so.4
> #6 0xb6bc7d90 in ?? ()
> Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Ahah. DNS timeouts and multithreaded apps have some issues. To quote the
libcurl-tutorial, "When using multiple threads you should set the
CURLOPT_NOSIGNAL option to TRUE for all handles." Also, timeouts during
DNS using the native DNS resolver without configuring with
--enable-threaded-resolver can cause problems (e.g. segfaults) on some
platforms.

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