I'm developing a web'n'database app using Apache::Registry and DBI.
The app has been in use for about six months, and I continue to make
incremental improvements (on a separate server that is only used for
development purposes) to the code.  At some point late last week, one
afternoon while I was playing around with one of my long CGI.pm-ish
print statements and repeatedly reloading the page in my browser to
see what my changes looked like, I started getting errors like this:

Software error:
[Mon Jan 31 17:08:06 2000] cider: Out of memory during "large" request
for 134221824 bytes at /usr/local/apache/cider//cider line 18. BEGIN
failed--compilation aborted at /usr/local/apache/cider//cider line 20.

The error happens intermittently, usually about 1 out of every 4 to 8
page loads (followed links, from submissions, reloads, whatever).  The
number "134221824 bytes" is always the same.  I can't think of
anything in my app that would want that much memory, nor can I think
of anything I was editing the day this began that might be related to
this.  I had never seens this error before, in many months of regular
work on the code, and now I see it every day, so I must have done
something to introduce this problem but I don't know where to look.

I did restart apache.  That did no good.  I stopped apache entirely,
then started it fresh, and was careful not to touch the program, so
that mod_perl would only want to compile it once for each httpd
process and not recompile it.  But that didn't help either.

Here's what I'm using:
 - Solaris 2.6
 - Perl 5.005_03
   + DBI 1.13
   + DBD::Informix 0.60
   + CGI 2.56
   [several other modules]
 - Apache 1.3.9
   + mod_perl 1.21
   + mod_ssl 2.4.9 (built with OpenSSL 0.9.4)
 - Informix Dynamic Server 7.3.UC10

I have no BEGIN blocks in my program, so I assume this is coming from
a used module somewhere.  Here are the first 20 lines of my program:

----------------------------------------------------------------------
#!/usr/bin/perl               

require 5.004;
use Apache;
use Apache::Log;
use IP;
use IPnet;
use DBI;
use Tie::DBI;
use CGI qw(:all);
use CGI::Carp qw(fatalsToBrowser carpout);
use CGI::Cookie qw(:standard);
use Digest::MD5  qw(md5 md5_hex md5_base64);

$ENV{INFORMIXSERVER} = "ciderdb";
$ENV{INFORMIXDIR} = "/informix";
$ENV{ONCONFIG} = "onconfig.$ENV{INFORMIXSERVER}";
$SIG{__WARN__} = sub { $warning .= $_[0] };

use constant NL => "<br>\n";
----------------------------------------------------------------------
And here's the <Perl> block from my Apache conf file:

<Perl>
$ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/
  or die "GATEWAY_INTERFACE = $ENV{GATEWAY_INTERFACE}\n";

use Apache;
use Apache::Log;
use Apache::Constants qw(:common :response :http);
use Digest::MD5  qw(md5 md5_hex md5_base64);
use CGI qw(-compile :all);
use CGI::Carp qw(fatalsToBrowser);
use CGI::Cookie qw(:standard);
use LWP::UserAgent;
use DBI;
use Tie::DBI;
use IP;
use IPnet;
</Perl>

The modules IP and IPnet are ones I wrote for this app's use, and they
haven't been touched for months.  Since I put in use statements in the
<Perl> section for all the modules I use in my program, they shouldn't
need to be recompiled at all, should they?

The error message gets logged in Apache's error log, and sent to the
web browser (due to CGI::Carp).  I don't see anything logged in
/var/adm/messages when this happens.  Where do I look for this problem?

  --  Cos (Ofer Inbar)  --  [EMAIL PROTECTED]  [EMAIL PROTECTED]
  --  Exodus Professional Services  --  [EMAIL PROTECTED]
 "This may seem a bit weird, but that's okay, because it is weird."
    -- Larry Wall in perlref(1) man page, Perl 5.001

Reply via email to