curl-library
Re: llist->next off by one
Date: Wed, 12 Nov 2003 10:30:15 +0100
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:
[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.
-- Beppe
----- Original Message -----
> Date: Tue, 11 Nov 2003 18:33:26 +0100 (CET)
> From: Daniel Stenberg <daniel-curl_at_haxx.se>
> To: libcurl Mailing list <curl-library_at_lists.sourceforge.net>
> Subject: Re: llist->next off by one
> Reply-To: curl-library_at_lists.sourceforge.net
>
> On Mon, 10 Nov 2003, Giuseppe Attardi wrote:
>
> > The following occurred to me in hash.c,
> > at line 259 in function Curl_hash_clean_with_criterium:
>
> > (gdb) p *$.next
> > $89 = {ptr = 0x8663dc0, prev = 0x915dae0, next = 0x8570367}
> > (gdb) p *$.next
> > $90 = {ptr = 0x47fb1000, prev = 0x662bb008, next = 0x8}
> >
> > The value of next in $89 is off by one.
>
> Ouch. Is this situation repeatable?
>
> Very odd sympthom indeed.
>
> --
> 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