cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: segfault in ConnectionKillOne

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sat, 18 Sep 2004 09:45:08 +0200 (CEST)

On Fri, 17 Sep 2004, Josh Anon wrote:

> 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).

The easy handle is re-used once and then closed?

> 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.

Since you said in another mail that you run this on Linux, can you try using
valgrind when running your program to see if you learn something more?

This problem indicates a memory problem somewhere else, as the 'conn' pointer
is simply fetched from an array and this code has worked fine for a very long
time with no failures.

> 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.

Since you only connect to two sites, having MAXCONNECTS set to 2 or higher
shouldn't make a difference in libcurl behaviour. It does make a different in
how memory is allocated and placed, so this only makes be believe strong on a
wild memory write or something.

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

What "apache output" are you referring to? You can use options and callbacks
to take care of all data and headers.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-09-18