cURL / Mailing Lists / curl-library / Single Mail

curl-library

segfault in ConnectionKillOne

From: Josh Anon <josha_at_pixar.com>
Date: Fri, 17 Sep 2004 10:37:18 -0700

This is a nice stumper. I'm using libcurl to do 2 really easy
tasks--get a file from an apache webserver (on windows) and upload the
file to a different apache webserver (also on windows). I'm using
curl_easy, and the code generally works without any problem. We're
using curl-7.10.8, but I tried this with 7-12.1 and have the same
problem.

However, very randomly (more in the past 2 weeks for some reason) but
repeatably on one machine, curl segfaults in ConnectionKillOne called
via curl_easy_cleanup at "score = Curl_tvdiff(now, conn->now);"

In the debugger, conn is not NULL, but the debugger reports it's
pointing at a bad address.

I tried messing around with the MAXCONNECTS argument (I'll admit I
wasn't sure about what I was doing), and setting it to 2, 4, and 6
caused curl to die elsewhere.

As a quick side note, is there some way to shut the curl put up so that
i don't see the apache output?

Here's my code:

    curl= curl_easy_init();
     if (curl) {
                outFile = fopen(dest, "w");
                if (outFile == NULL) {
                    fprintf(stderr, "Unable to open %s for writing\n", dest);
                    return FXT_Error;
                }

        /* where to get from */
        curl_easy_setopt(curl, CURLOPT_URL, srcURL);
        /* where to go */
        curl_easy_setopt(curl, CURLOPT_FILE, outFile);
        /*
          * user/pass (not needed with the current get config, but
         * this could change)
         */
        sprintf(pw, "%s:%s", XENON_USER, XENON_PASSWORD);
        curl_easy_setopt(curl, CURLOPT_USERPWD, pw);

        curl_easy_setopt(curl, CURLOPT_VERBOSE, 0);
        curl_easy_setopt(curl, CURLOPT_MUTE, 1);
        
        res = curl_easy_perform(curl);
        
        curl_easy_cleanup(curl);
        fclose(outFile);

TIA,
Josh

---
Josh Anon
Studio Tools, Pixar Animation Studios
josha_at_pixar.com
Received on 2004-09-17