Bug 10206 - PerlRequire crashing apache
Summary: PerlRequire crashing apache
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: apache
Version: 6.1
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-03-16 14:49 UTC by jjanssen
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2000-03-20 13:38:49 UTC
Embargoed:


Attachments (Terms of Use)

Description jjanssen 2000-03-16 14:49:17 UTC
I am having problems with apache and mod_perl on my 6.1 box.  This problem
is introduced when I have a PerlRequire statement that loads a startup
script (which, in turn, loads my modules).  What happens if I do an
/etc/rc.d/init.d/httpd start is that it says 'OK', but nothing is started.
If I start httpd in single process mode 'httpd -X', I get a segmentation
fault.  If I comment out the PerlRequire, then everything starts fine, but
I need to be able to use a startup script to share memory.

==========================================================

Noticing that there are several similar bugs already resolved, I
downloaded  and installed apache-1.3.12-1 and mod_perl-1.21-9 and I now get
this error when I start apache:

Syntax error on line 242 of /etc/httpd/conf/httpd.conf:
API module structure `perl_module' in file /etc/httpd/modules/libperl.so is
garbled - perhaps this is not an Apache module DSO?


Line 242 is this line:

LoadModule perl_module          modules/libperl.so

======================================================
Understanding that rawhide is called that for a reason, I downloaded
apache-1.3.11-4 and mod_perl-1.21-2 from the 6.2-beta directory and tried
them.  The result is I get the same problem as with the original version.

I have determined that it is not my modules causing the crash by putting a
simplistic startup script in a PerlRequire that simply starts one module
(CGI.pm).  The startup script does work, however, if there are no use <lib>
statements.

I am not running any special modules except mod_perl (no mod_php)

Comment 1 Nalin Dahyabhai 2000-03-16 21:16:59 UTC
I tried it with the versions of Apache (1.3.12-1) and mod_perl (1.21-9) in Raw
Hide (ftp://ftp.redhat.com/pub/rawhide/i386/RedHat/RPMS/) and am unable to
reproduce this here with this in /etc/httpd/lib/perl/init.pl:
===cut===
#!/usr/bin/perl

require MD5;
require CGI;

print "Perl initialized!\n";

1;
===cut===
Here's the modified section of my httpd.conf file:
===cut===
# If the perl module is installed, this will be enabled.
<IfModule mod_perl.c>
  Alias /perl/ /home/httpd/perl/
  <Location /perl>
    SetHandler perl-script
    PerlHandler Apache::Registry
    Options +ExecCGI
  </Location>
  PerlRequire init.pl
</IfModule>
===cut===
This may have been fixed in newer versions I incorporated into the distribution
when I did the sweep to update Apache and its modules.  Raw Hide's last update
as of this writing was February 28, and included all of the bugs we fixed in the
tree between the Piglet beta and the moment Raw Hide froze that day.

Comment 2 jjanssen 2000-03-17 13:56:59 UTC
I've retried apache-1.3.12-1 with mod_perl-1.21-9 and get the same error above.
Syntax error on line 242 of /etc/httpd/conf/httpd.conf:
 API module structure `perl_module' in file /etc/httpd/modules/libperl.so is
 garbled - perhaps this is not an Apache module DSO?  I've tried starting with
older versions of apache and rpm -U up to the current, and also a fresh install
(rpm -i after rpm -e) with the same results.

I tried the same thing you tried with the simple startup script with a few rev's
back from rawhide with the default httpd.conf (with mod_perl and your changes)
and the init.pl is the same.

[root@p171098 apache]# rpm -q apache
apache-1.3.9-8
[root@p171098 apache]# rpm -q mod_perl
mod_perl-1.21-2
[root@p171098 apache]# /etc/rc.d/init.d/httpd start
Starting httpd:                                            [  OK  ]
[root@p171098 apache]# ps axf
  PID TTY      STAT   TIME COMMAND
    1 ?        S      0:07 init
    2 ?        SW     0:00 [kflushd]
    3 ?        SW     0:01 [kupdate]
    4 ?        SW     0:00 [kpiod]
    5 ?        SW     0:00 [kswapd]
    6 ?        SW<    0:00 [mdrecoveryd]
  438 ?        S      0:00 portmap
  493 ?        S      0:00 syslogd -m 0
  504 ?        S      0:00 klogd
  520 ?        S      0:00 /usr/sbin/atd
  536 ?        S      0:00 crond
  556 ?        S      0:00 inetd
 1469 ?        R      0:00  \_ in.telnetd
 1470 pts/1    S      0:00      \_ login -- eprint
 1471 pts/1    S      0:00          \_ -bash
 1482 pts/1    S      0:00              \_ su -l
 1483 pts/1    S      0:00                  \_ -bash
 7129 pts/1    R      0:00                      \_ ps axf
  572 ?        S      0:00 lpd
  610 ?        S      0:00 sendmail: accepting connections on port 25
  627 ?        S      0:00 gpm -t ps/2
  670 ?        S      0:00 xfs -droppriv -daemon -port -1
  706 tty1     S      0:00 login -- root
  714 tty1     S      0:00  \_ -bash
  708 tty3     S      0:00 /sbin/mingetty tty3
  709 tty4     S      0:00 /sbin/mingetty tty4
  710 tty5     S      0:00 /sbin/mingetty tty5
  711 tty6     S      0:00 /sbin/mingetty tty6
 1290 tty2     S      0:00 /sbin/mingetty tty2

! not running!

[root@p171098 apache]# which httpd
/usr/sbin/httpd
[root@p171098 apache]# /usr/sbin/httpd -X
Perl initialized!
Segmentation fault (core dumped)

This seems to be consistent with basically every version of apache I can get my
hands on, including the secure webserver, but excluding the rawhide (since I
can't get that far in the startup process) and this case:

[root@p171098 apache]# rpm -q apache
apache-1.3.6-7
[root@p171098 apache]# rpm -q mod_perl
mod_perl-1.19-2
[root@p171098 apache]# /usr/sbin/httpd -X &
[1] 7286
[root@p171098 apache]# Perl initialized!
Perl initialized!

[root@p171098 apache]#

!We're good, my biggest problem is that I can get one of three things that seem
to be mutually exclusive, but I need all three:
a) The latest version of apache
b) mod_perl
c) secure webserver
If this bug is fixed in the rawhide+ version, how long will it be before a
secure version comes out?
Thanks for your help.

Comment 3 Nalin Dahyabhai 2000-03-17 14:25:59 UTC
A new version of secureweb (3.2) will be in Red Hat Linux Professional 6.2 when
it ships, and I'm not really certain just now when that will be.  At the moment,
secureweb is tracking changes made to the regular Apache packages because I'm
maintaining both of them, and we've verified that they can use the same DSOs
without problems (Apache from Raw Hide should have the EAPI patch pulled into
it, which should simplify sharing).

Taking another look at your report, it looks like Apache is looking for the
libperl.so module in /etc/httpd/modules, which should be a symlink to
/usr/lib/apache.  Does the path resolve to the right file?

If nothing else works, you might want to grab the updated Apache .src.rpm file,
run "rpm --rebuild" on it, upgrade to the new apache and apache-devel packages
that get built, and rebuild mod_perl specifically for your system by following
a similar process.  This should fix any inconsistencies that crop up.

Comment 4 jjanssen 2000-03-20 13:38:59 UTC
I've found a fix that is acceptable for now.  In the httpd.conf file, simply do
the LoadModule and AddModule for mod_perl before any others.  It worked for me!
Compliments to Bug: 8169.

Comment 5 Nalin Dahyabhai 2000-07-10 19:22:42 UTC
Verified that this still works with apache-1.3.12-16 and mod_perl-1.24-2.


Note You need to log in before you can comment on or make changes to this bug.