You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Neil Gunton <ne...@home.nilspace.com> on 2002/11/09 21:05:13 UTC
2.x Execute crash in startup.pl
Hi again Gerald,
Further adventures in converting to 2.x: I have a function in startup.pl which
preloads my Embperl pages, so that they will run in shared memory (as much as
possible). This works with Embperl 1.x, but causes apache to crash in
Embperl-2.0b9_dev-3. The error is as follows:
[root@dev src]# httpsdctl start
$path = :/www/vhosts/www.neilgunton.com/htdocs:/www/lib/perl/Apache/
Embperl::Execute body.html
[2783]ERR: 56: : Unknown Provider epcompile
/usr/local/apache/bin/httpsdctl: line 171: 2783 Segmentation fault $HTTPD
/usr/local/apache/bin/httpsdctl start: httpsd could not be started
The startup.pl is as follows (fails on the call to Embperl::Execute):
#!/usr/local/bin/perl
# First modify the include path
BEGIN
{
use strict;
use Apache ();
use lib '/www/lib/perl';
}
# Common modules
use Apache::Registry ();
use Apache::Constants ();
use Apache::File ();
use Apache::Log ();
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 DBI ();
DBI->install_driver('mysql');
use Digest::HMAC_MD5 qw(hmac_md5_hex);
use SOAP::Lite ();
# 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 mysql squid);
# 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, # Files to be processed, e.g. '*.html *.epl'
@search_path # List of paths for Embperl to search for files
) = @_;
@search_path = () if !@search_path;
# 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 "\$path = $path\n";
print "Embperl::Execute $filename\n";
Embperl::Execute ({inputfile => $filename,
import => 0,
path => $path,
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;
Any ideas? Should I be doing this differently with 2.x?
TIA
-Neil
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: 2.x Execute crash in startup.pl
Posted by Neil Gunton <ne...@home.nilspace.com>.
Gerald Richter <ri...@ecos.de> wrote:
> it would be very helpfull if you can compile with
>
> perl Makefile.PL debug
> make install
>
> and then start the httpd with the -X option under gdb
>
> gdb httpd
> set args -f httpd.conf -X
> r
>
> when you get the sigsegv type BT and send me the backtrace
Ok, here's the results of the gdb:
(gdb) set args -f /www/conf/httpd.conf -X
(gdb) r
Starting program: /usr/local/apache/bin/httpsd -f /www/conf/httpd.conf -X
[New Thread 1024 (LWP 2113)]
$path = :/www/vhosts/www.neilgunton.com/htdocs:/www/lib/perl/Apache/
Embperl::Execute /www/vhosts/www.neilgunton.com/htdocs/body.html
[2113]ERR: 56: : Unknown Provider epcompile
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 2113)]
EMBPERL2_ArrayGetSize (a=0x8af224c, pArray=0x0) at epdom.c:685
685 return pCtrl -> nFill ;
(gdb)
Hope this helps...
Thanks again!
-Neil
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: 2.x Execute crash in startup.pl
Posted by Gerald Richter <ri...@ecos.de>.
> [root@dev src]# httpsdctl start
> $path = :/www/vhosts/www.neilgunton.com/htdocs:/www/lib/perl/Apache/
> Embperl::Execute body.html
> [2783]ERR: 56: : Unknown Provider epcompile
> /usr/local/apache/bin/httpsdctl: line 171: 2783 Segmentation fault
$HTTPD
> /usr/local/apache/bin/httpsdctl start: httpsd could not be started
>
it would be very helpfull if you can compile with
perl Makefile.PL debug
make install
and then start the httpd with the -X option under gdb
gdb httpd
set args -f httpd.conf -X
r
when you get the sigsegv type BT and send me the backtrace
Gerald
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org