Gerald Richter wrote:
> 
> H Neil,
> 
> > following code seems to be a minimal case for making the bug manifest:
> >
> > [- $count = 0 -]
> > <DL>
> >      [$ while $count < 10 $]
> >         <DL>
> > <DD>[- print OUT $count; -]
> > </DL>
> > [- $count++ -]
> >      [$ endwhile $]
> > </DL>
> >
> 
> Also you might believe that it never will happen, the DL nesting bug is now
> fixed in the CVS version.
> 
> Sorry, for the very long delay.I try to be quicker the next time you report
> a bug :-)
> 
> Gerald

Hi Gerald,

I assume that this patch is in the latest 2.0b10 (which was announced
the day after this bugfix), so I am testing with that. However I've
immediately run into a problem with starting Apache. I'm running 1.3.29,
mod_perl 1.29, compiled with gcc 3.3.2 (from source) and Red Hat 7.3
(fully patched).

When I start apache, I get the following errors from startup.pl:

[7748]ERR:  56: : Unknown Provider epcompile 
Embperl::Execute /www/vhosts/www.neilgunton.com/htdocs/index.html
[7748]ERR:  56: : Unknown Provider epcompile 
Embperl::Execute /www/vhosts/www.neilgunton.com/htdocs/test.html
etc

This is caused by startup.epl attempting to preload all my modules (in
order to share as much memory as possible between the apache children).
This works fine under 1.3.6. After the whole string of errors like the
ones above for every module, the message is that Apache has started, and
I can see the child processes, but when I try to access any page, I get
a segmentation fault:

[Sat Jan 24 17:59:12 2004] [notice] child pid 7790 exit signal
Segmentation fault (11)

These may well be two separate issues - I would just like to know if the
first 'Unknown Provider epcompile' is anything you've seen before? Below
is the startup.pl that causes this error.

What would you like me to do regarding the segfault?

Thanks,

-Neil

#!/usr/bin/perl

# First modify the include path
BEGIN
{
    use strict;
    use Apache ();
    use lib '/www/lib/perl';
}


# Common modules
use Apache::Constants ();
use Apache::File ();
use Apache::Log ();
use IO::Zlib ();
use Safe ();
use URI::Escape ();
use Log::Logger ();
use File::Copy ();
use File::Path ();
use File::Glob ();
use Time::Zone ();
use CGI qw (-compile :cookie cgi_error header);
use Date::Calc qw(:all);
use Image::Magick ();
use HTML::Embperl ();
use HTML::EmbperlObject ();
use Embperl ();
use Embperl::Object ();
use Mail::Sender;
use LWP::UserAgent;
use HTTP::Request;
use DBI ();
DBI->install_driver('mysql');
use Digest::HMAC_MD5 qw(hmac_md5_hex);
use SOAP::Lite ();
use Text::Wrap;

# My modules
use Apache::BlockAgent ();
use Apache::Nilspace::Main::Access ();
use Apache::Nilspace::Subscription::Access ();
use Apache::Nilspace::Subscription::Handler ();
use Nilspace ();
use Nilspace::Agenda ();
use Nilspace::Commerce ();
use Nilspace::Mail ();

# Apache::VMonitor
use Apache::VMonitor();
$Apache::VMonitor::Config{BLINKING} = 1;
$Apache::VMonitor::Config{REFRESH}  = 0;
$Apache::VMonitor::Config{VERBOSE}  = 0;
$Apache::VMonitor::Config{SYSTEM}   = 1;
$Apache::VMonitor::Config{APACHE}   = 1;
$Apache::VMonitor::Config{PROCS}    = 1;
$Apache::VMonitor::Config{MOUNT}    = 1;
$Apache::VMonitor::Config{FS_USAGE} = 1;
$Apache::VMonitor::Config{SORT_BY}  = 'size';
$Apache::VMonitor::PROC_REGEX = join "\|", qw(httpd_proxy httpd_perl
mysql );

# For handling the remote ip address through mod_proxy reverse proxy
sub My::ProxyRemoteAddr ($)
{
    my $r = shift;
                                    
    # we'll only look at the X-Forwarded-For header if the requests
    # comes from our proxy at localhost
    return Apache::Constants::OK 
        unless ($r->connection->remote_ip eq "127.0.0.1") 
        and $r->header_in('X-Forwarded-For');
                                   
    # Select last value in the chain -- original client's ip
    if (my ($ip) = $r->headers_in->{'X-Forwarded-For'} =~ /([^,\s]+)$/)
    {
        $r->connection->remote_ip($ip);
    }
    
    return Apache::Constants::OK;
}

# Preload Embperl website code
if (lc($ENV{PRELOAD_WEBSITES}) eq 'on')
{
    preload_dir ('/www/lib/perl/Apache', '*.html *.epl');
    preload_dir ('/www/vhosts/www.neilgunton.com/htdocs', '*.html
*.epl');
    preload_dir ('/www/vhosts/www.crazyguyonabike.com/htdocs', '*.html
*.epl');
}

# Recursive directory traversal sub which preloads Embperl files
sub preload_dir
{
    my ($dir,            # The current directory which is to be
processed
        $pattern,        # A pattern identifying files to be processed, e.g.
'*.html *.epl'
        @search_path     # List of paths for giving to Embperl to search for
files
        ) = @_;

    @search_path = () if [EMAIL PROTECTED];

    # Put the current dir on the search path
    push (@search_path, $dir);

    local *DIR;
    opendir (DIR, $dir) or die "Could not open directory: $dir: $!";

    # First, process files in this directory
    # Pattern consists of a potential list of patterns, separated by
spaces.
    # First we make a list of patterns, and then glob each of these
    foreach my $glob (split (/\s/, $pattern))
    {
        # Iterate through the resulting list of files
        foreach my $file (File::Glob::glob ("$dir/$glob"))
        {
            if (!(-d $file) && (-e $file))
            {
                # Build up the paths, starting with the current dir and working back
up to the website root
                my $path = '';
                foreach my $i (1 .. scalar(@search_path))
                {
                    $path .= ':' . $search_path[scalar(@search_path) - $i];
                }
                $path .= ':/www/lib/perl/Apache/';
                $file =~ /\/([^\/]+)$/;
                my $filename = $1;
                print "Embperl::Execute $file\n";
                Embperl::Execute ({inputfile => $file,
                                   path => $path,
                                   import => 0,
                                   escmode => 0,
                                   options => 16
                                   }) ;
            }
        }
    }

    # Now, recursively go down into subdirectories
    while (defined(my $subdir = readdir (DIR)))
    {
        # Only recurse on directories, which do not start with ".", and skip
symbolic links
        if (-d "$dir/$subdir" &&
            !(-l "$dir/$subdir") &&
            ($subdir !~ /^\.{1,2}$/))
        {
            
            preload_dir ("$dir/$subdir", $pattern, @search_path);
        }
    }
}

1;

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to