Strange Perl STDERR/FCGI interaction

Steve Ferguson <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <Pine.LNX.4.58.0409230804190.13174@dogbert>
Hi folks,

I'm working with Apache 1.3.26 and mod_fastcgi-2.4.2.

Using a Perl 5.6.1 installation with FCGI 0.58, everything is working
fine.  Using a Perl 5.8.5 installation with FCGI 0.67, I'm getting some
strange issues with STDERR redirection being reset.  In particular I
have one bit of code here that redirects STDERR like so:

    open(MYSTDERR, ">>$file") or die "Can't open log file $file";
    open(STDERR, ">&MYSTDERR") or die "can't redirect standard error";

When I call this as a "normal" CGI under either Perl interpreter, the
error redirection works fine.  I've tracked down the point of failure
to this block, which is inside of an accept loop taking new FCGI requests.

warn "STF: new_request() middle1: ". $SIG{__WARN__};
    if ($self->{_requester}->Accept() >= 0) {
warn "STF: new_request() middle2: ". $SIG{__WARN__};

I included the SIG big to ensure my warn handler wasn't getting reset.
It's not.

The first warn gets written to my alternate error log.  The second
warn gets written to the server's STDERR and captured in my main
Apache error_log file.  I don't want it to do that.  If I switch the
interpreter on the script back to the Perl 5.6.1 installation the same
code works fine.  I've looked at the guts of FCGI.pm and there's not
anything that seems like it should be affecting this.

Can anyone give me a clue as to what the heck is going on here?  How is
STDERR getting unset?  If there's a better way to approach this, please
point me in the right direction.

Thanks,
Steve

-- 
Steve Ferguson                        | "Men never do evil so completely
Email: [email protected]        | and cheerfully as when they do
http://dogbert.dnsalias.org:8080/~stf | it from a religious conviction."
                                      |   --Blaise Pascal

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.