cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: llist->next off by one

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 12 Nov 2003 11:19:01 +0100 (CET)

On Wed, 12 Nov 2003, Giuseppe Attardi wrote:

> It looks like the problem is due to a lack of thread safeness. The hostcache
> data structure seems to be shared among threads, according to what I see
> with gdb when the problem occurrs:

The host cache is not supposed to be shared between threads unless specificly
told so, either by using the global dns cache option or by using the share
interface.

I must admit I can't see in what way it shares the data.

> [Switching to thread 16 (Thread 14351 (LWP 19859))]
> Curl_hash_clean_with_criterium (h=0x81cb8a0, user=0x4c1ff46c,
> comp=0x812eeb4 <hostcache_timestamp_remove>) at hash.c:256
> (gdb) p list.head
> $1 = (curl_llist_element *) 0x84c7718
>
> [Switching to Thread 12301 (LWP 19857)]
> Curl_hash_clean_with_criterium (h=0x81cb8a0, user=0x4adff46c,
> comp=0x812eeb4 <hostcache_timestamp_remove>) at hash.c:256
> (gdb) p list.head
> $8 = (curl_llist_element *) 0x84c7718
>
> If this is the problem, syncronization must be added in dealing with the dns
> host cache. I can help on that if you like.

And this is without a global cache selected?

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
 [[ Do not post private mails to this email address. They won't reach me. ]]
-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
Received on 2003-11-12