Apache/Linux returns partial page

Kevin Kreger (kreger@mr.med.ge.com)
Wed, 29 Jan 1997 18:00:52 -0600

Message-Id: <32EFE4B4.1D70@mr.med.ge.com>
Date: Wed, 29 Jan 1997 18:00:52 -0600
From: Kevin Kreger <kreger@mr.med.ge.com>
To: fastcgi-developers@OpenMarket.com
Subject: Apache/Linux returns partial page

Name: Kevin Kreger
Email: kreger@mr.med.ge.com

OS:
    _ BSD/OS 1.1
    _ Ditial UNIX V3.2.148
    _ Hewlett-Packard HP-UX A.09.05
    _ Hewlett-Packard HP-UX B.10.01
    _ IBM AIX 1.4
    _ SGI IRIX 5.3
    _ Sun Solaris 2.4/2.5
    _ Sun SunOS 4.1.4
    X Other: Red Hat Linux 2.1 (Linux Kernel 1.2.13)

Web Server:
    _ OpenMarket's Secure Web Server,   Version:
    X Apache Web Server,                Version: 1.2b4
    _ NCSA Web Server,                  Version:
    _ Other:                            Version:

FastCGI application's language:
    _ ANSI C,                           Compiler:
    X Perl,                             Version:  5.003
    _ Perl w/ SFIO support,             Version:
    _ Tcl,                              Version:
    _ Java,                             Version:
    _ Python,                           Version:
    _ Other:                            Version:

FastCGI Developer's Kit                 Version: 1.5.1
mod_fastcgi (if applicable)             Version: Got latest on 1/22/97

Directives:
    AppClass:
        AppClass /home/faxus/www/fcg/chat3.fcg -processes 1 -priority 8
        
    ExternalAppClass:
        None
         
    Other:
        AddType application/x-httpd-fcgi fcg
 

Description of the problem:
        
First: Thanks to OpenMarket for coming up with FastCGI and
good luck with W3C standardization. You've got my support
and it sounds like you have Tim B-L's also!!!!

I would like to note a few minor things that you probably
already know about:  The instructions for installing FCGI
and updating Perl do not handle the case for the latest version
of perl.c under 5.003...so some people may have problems with
misinterpreting the instructions on your page. The new perl.c
does not need the patch.

Unless I use the -processes flag set to 1 then 2 instances
of the fcg are created when I restart httpd.  The -listen-queue-depth
flag is not recognized and gives me an error so I can't use it :-(

Okay..now the real problem:
I've written a fastcgi chat script (http://www.faxus.com/fcg/chat3.fcg)
that runs fine for a while...It's single threaded and has a message
queue as an associative array.  After the chat is running for 'a while'
I start to get these errors intermittently:

mod_fastcgi.c:1637: failed assertion `count >= 0 && count
<=bufPtr->length'

(From the BufferToss function)

Just playing around with the chat with a few people in it
will not replicate the problem...It really has to be loaded
for a little while before it crops up.  What happens (visibly)
in the chat is the message queue begins to get double postings
and *sometimes* the ouput will be truncated (usually when there
are some lareger postings in the page). I've hacked this thing and
then finally gave up and submitted this bug report just like
a good programmer should.  One other thing worth noting is after
this happens there begins a trend of ~lots~ of httpd processes
being started until I have dozens and my server grinds down
to a virtual halt.  I'm fairly certain that this does not begin to
occur until the above message is posted.


Here's some errors that show up in Apache's error_log:

[Thu Jan 23 10:14:02 1997] - lingering_close
[Thu Jan 23 10:16:59 1997] accept: Connection reset by peer
[Thu Jan 23 10:16:59 1997] - socket error: accept failed
[Thu Jan 23 10:18:20 1997] accept: Connection reset by peer
[Thu Jan 23 10:18:20 1997] - socket error: accept failed
[Thu Jan 23 10:18:20 1997] accept: Connection reset by peer


If you want the perl source for chat3.fcg to monkey
with let me know.

Keep up the good work!!!

Kevin Kreger