cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Seldom SegFaults within getenv on x64 architecture

From: Ingo Krabbe <ikrabbe.ask_at_web.de>
Date: Thu, 13 Mar 2008 17:31:23 +0100

Ok, this is a problem. I detected and located the source of this error and

ITS NO FAULT OF libcURL itself, though its a problem when using it as I do:

(FCGI=fast CGI as supported by mod_fcgid)

Again: I use it as an FCGI Application that is called by an apache httpd.
What I actually Do is: I get a request from the web server that results in
another request to another host, but I don't want the client to wait for the
completion of the request but I will give him a unique id, so that he can
reference later to the requested data and see if I'm ready processing it.

Then in background the libcURL requests to the other servers are processed and
the results are stored for later shipment.

What happens is that: The apache httpd server builds an own process
environment for each single request to the fcgi_application, the
fcgi_application process itself stays in memory. The process environment is
only valid between the FCGI_accept call and the shipment of the answer. But
the cURL callbacks are handled in the idle time too, where no request from
the apache httpd is active.

So when libcURL tries to read the environment within this idle time, which it
does, when a new request is scheduled on the base of the finished old one,
the environment isn't valid anymore and getenv itself segfaults reading the
environ pointer (internally).

Next I will try to provide an idle time environment for the process.

Maybe you have other/better ideas to solve this problem.
Received on 2008-03-13