cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Re: ares again

From: Giuseppe Attardi <attardi_at_di.unipi.it>
Date: Mon, 13 Oct 2003 13:10:10 +0200

The problem arises because the connection
gets freed in Curl_disconnect:

(gdb) p &easy.easy_conn.connectindex
$8 = (int *) 0x8070b5c
(gdb) watch *(int *) 0x8070b5c
Hardware watchpoint 2: *(int *) 134679388
(gdb) c

Old value = 0
New value = 1108533832

(gdb) where
#0 0x4207add2 in chunk_free () from /lib/i686/libc.so.6
#1 0x4207ac24 in free () from /lib/i686/libc.so.6
#2 0x0804e456 in Curl_disconnect (conn=0x8070b58) at url.c:1353
#3 0x08050591 in Curl_async_resolved (conn=0x8070b58) at url.c:3246
#4 0x0804a3be in curl_multi_perform (multi_handle=0x80685e8,
    running_handles=0xbffffaa8) at multi.c:371
#5 0x08049913 in main (argc=1, argv=0xbffffb24) at bug.c:29

-- Beppe

----- Original Message -----
From: "Giuseppe Attardi" <attardi_at_di.unipi.it>
To: <curl-library_at_lists.sourceforge.net>
Sent: Monday, October 13, 2003 12:42 PM
Subject: [inbox] Re: ares again

> I enclose a short program that exibits the behavior.
> Notice that when it crashes, in Curl_disconnect
> connectindex has an anomalous value:
>
> (gdb) p conn->connectindex
> $2 = 1108533832
>
> -- Beppe
>
> #include "test.h"
>
> /*
> * Reuse same easy_handle within multi_handle
> * Works fine without ARES.
> */
>
> CURL* init(char* url)
> {
> CURL* c = curl_easy_init();
> curl_easy_setopt(c, CURLOPT_URL, url);
> curl_easy_setopt(c, CURLOPT_NOSIGNAL, 1);
> return c;
> }
>
> int main(int argc, char **argv)
> {
> CURL *c;
> CURLM *m;
> CURLMcode res;
> int running=1;
> int rest = 1;
>
> curl_global_init(CURL_GLOBAL_ALL);
> m = curl_multi_init();
>
> c = init("http://localhost:5678/robots.txt");
> curl_multi_add_handle(m, c);
> while (running) {
> res = curl_multi_perform(m, &running);
> if (running <= 0)
> break;
> }
> curl_multi_remove_handle(m, c);
> curl_easy_cleanup(c);
> curl_multi_cleanup(m);
>
> return 0;
> }
>

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
Received on 2003-10-13