cURL / Mailing Lists / curl-library / Single Mail

curl-library

SIGSEGV in resolver (redhat 6.0, 7.3)

From: Vojtech Janota <vojta_at_pohoda.cz>
Date: Sat, 7 Dec 2002 15:46:14 +0100 (CET)

Hi,

 I have following problem: I've downloaded latest curl and the very
simple program at the bottom of this mail crashes regularly on older
redhats (6.0 with glibc-2.2.4-19 and 7.3 with glibc-2.2.5-notsure).
It works ok with RedHat 8.

The program successfully fetches 290 pages (passed via stdin) and then
dumps core.

I guess this is a glibc problem. Is there any workaround? The program I'm
developing MUST run on a plain RedHat 7.x systems, but I would like to
make use of libcurl...

 Thanks for any input.

Regards,

Vojta

#0 0x40285aac in internal_getent (result=0x8080980, buffer=0x8080994
"\177",
    buflen=22180, errnop=0x40277c60, herrnop=0xbffff6b8, af=2, flags=0)
    at nss_files/files-XXX.c:188
#1 0x4028605a in _nss_files_gethostbyname_r (name=0x806e0a8
"imgt.cnusc.fr",
    result=0x8080980, buffer=0x8080994 "\177", buflen=22180,
    errnop=0x40277c60, herrnop=0xbffff6b8) at nss_files/files-hosts.c:260
#2 0x4023f6a0 in __gethostbyname_r (name=0x806e0a8 "imgt.cnusc.fr",
    resbuf=0x8080980, buffer=0x8080994 "\177", buflen=22180,
    result=0xbffff6b4, h_errnop=0xbffff6b8) at ../nss/getXXbyYY_r.c:200
#3 0x4001d0e6 in my_getaddrinfo (data=0x8050e78,
    hostname=0x806e0a8 "imgt.cnusc.fr", port=8104, bufp=0xbffff6f4)
    at hostip.c:619
#4 0x4001ce9a in Curl_resolv (data=0x8050e78,
    hostname=0x806e0a8 "imgt.cnusc.fr", port=8104) at hostip.c:253
#5 0x40027dff in CreateConnection (data=0x8050e78, in_connect=0xbffff9e8)
    at url.c:2675
#6 0x400281f8 in Curl_connect (data=0x8050e78, in_connect=0xbffff9e8)
    at url.c:2822
#7 0x4003140e in Curl_perform (data=0x8050e78) at transfer.c:1561
#8 0x400317de in curl_easy_perform (curl=0x8050e78) at easy.c:245
#9 0x804883f in main () at eval.c:41
#10 0x40163306 in __libc_start_main (main=0x8048780 <main>, argc=1,
    ubp_av=0xbffffab4, init=0x80485a0 <_init>, fini=0x80488b0 <_fini>,

#include <stdio.h>
#include <curl/curl.h>

int main(void)
{
        CURL *curl;
        CURLcode res;
        int i;

        curl = curl_easy_init();
        if(curl) {
                char *s = (char*)malloc(1024);
                i = 0;
                while(fgets(s, 1024, stdin)) {
                        fprintf(stderr, "%d: getting %s", ++i, s);
                        curl_easy_setopt(curl, CURLOPT_URL, s);
                        curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
                        curl_easy_setopt(curl, CURLOPT_TIMEOUT, 60);
                        res = curl_easy_perform(curl);
                }

                /* always cleanup */
                curl_easy_cleanup(curl);
        }
        return 0;
}

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-12-07