Re: FastCGI / Apache problems

Mark Brown (
Thu, 29 Aug 1996 12:22:34 -0400

Message-Id: <>
Subject: Re: FastCGI / Apache problems 
In-Reply-To: Your message of "Thu, 29 Aug 1996 11:07:49 EDT."
Date: Thu, 29 Aug 1996 12:22:34 -0400
From: Mark Brown <>

Bob Ramstad writes:

    this is a trace from an FCGI application which is SIGSEGVing
    occasionally... ideas?


Thanks for the very clear report.

The problem is almost certainly your use of putenv.  The FCGI_Accept.3
manpage documents that putenv can't be used in programs that use
FCGI_Accept.  It also documents how to grab the request environment in
a way that allows you to use putenv -- but then you are on your own
for accesses to the request environment, which getenv won't see.

The reason FCGI_Accept works the way it does is that I don't have a
lot of confidence in the consistency of storage management in
implementations of setenv/putenv and unsetenv on different platforms.
It *might* work to take the request environment you've grabbed as
described in the FCGI_Accept.3 manpage, call setenv for each
name-value pair, go do your thing, then call unsetenv for each name.
Or it might give you a seg fault or a storage leak.  I'd be interested
in learning what works for you.

I recommend that you use Purify if you can; it does a great job of
diagnosing this sort of problem.