cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Does libcurl really entirely thread-safe?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 9 Feb 2006 23:15:36 +0100 (CET)

On Thu, 9 Feb 2006, Du, Eric wrote:

> OS: AIX 5.2
> Compiler: xlc_r
> curl/libcurl src version: 7.15.1

> I use libcurl in multi-thread mode, By instrumenting the compiler code and
> running it within dbx, we received a SIGTRAP in function Curl_resolv, line
> 381, file hostip.c:
>
> #ifdef HAVE_SIGSETJMP
> /* this allows us to time-out from the name resolver, as the timeout
> will generate a signal and we will siglongjmp() from that here */
> if(!data->set.no_signal && sigsetjmp(curl_jmpenv, 1)) {

....

This is the key. You really should set CURLOPT_NOSIGNAL when you use libcurl
multi-threaded. The tutorial section you mentioned even says that. (Even it it
claims that "Everything will work fine except...")

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2006-02-09