cURL / Mailing Lists / curl-library / Single Mail


libcurl strange behaviour

From: Julien MOUTTE <>
Date: Wed, 14 Nov 2001 17:59:35 +0100

Dear all,

I m programming a C TCP daemon that forks itself and manage client connection
in separate processes...

The job of these child will be to issue an https query trough curl.

I am making call to curl_global_init, easy_init, easy_cleanup & global
cleanup each time for each process to avoid memory leaks.

Each time i'm testing the daemon, the first forked child succeed in its query
but the second forked child taking care of another client fails to make a
curl_easy_init and the program crash mysteriously

Here is the block of code i am using in a function called http_query (char

        if (curl_global_init(CURL_GLOBAL_ALL)==0) {
                log_write(flog, DEBUG, "Initing done URL %s with CURL", url);
                curl_easy_setopt(curl_handler,CURLOPT_URL, url);
                curl_easy_setopt(curl_handler,CURLOPT_FAILONERROR, 1);
                curl_easy_setopt(curl_handler,CURLOPT_LOW_SPEED_LIMIT, 1);
                curl_easy_setopt(curl_handler,CURLOPT_LOW_SPEED_TIME, 120);
                curl_easy_setopt(curl_handler,CURLOPT_TIMEOUT, 180);
                curl_easy_setopt(curl_handler,CURLOPT_NOPROGRESS, 1);
                log_write(flog, DEBUG, "Options set", url);
                log_write(flog, DEBUG, "Query executed", url);

NB : The message "Initing done ..." never appears in the logs.. so i guess
the call to easy_init makes the process crash but as a forked daemon it's
hard to debug it ..

using curl-devel-7.8-1 rpm on redhat 7.2

Any help appreciated.

Thanks & Regards

Julien MOUTTE -
World Trade Center, Moll de BARCELONA
Edificio Norte 4 Planta
Tel : +34 93600 23 23 Fax : +34 93600 23 10
Received on 2001-11-14