Segmentation fault when starting Apache 2.2.26 with Perl 5.18.1 and mod_perl 2.0.8

Paul Burton <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
I'm using Slackware 14.1, but since it includes Apache 2.4 (which based
on what I've read is no compatible with mod_perl), I removed it and
installed the latest Apache 2.2 from source. Once that was done, I
confirmed that the basic installation was working (Got the "It works!"
page when I loaded localhost:80).

I downloaded mod_perl 2.0.8 and made sure all its dependencies were
installed (the official docs said to just install Bundle::Apache2 from
CPAN).

The module installed correctly once I provided the path to apxs in the
Apache bin directory.

I made sure that mod_perl.so was installed in the modules directory and
added "LoadModule perl_module modules/mod_perl.so" to httpd.conf.

But here's what happens when I try to start the server (and I did make
sure there were no other httpd processes running):

root@nas:~# /usr/local/apache2/bin/apachectl start
/usr/local/apache2/bin/apachectl: line 78: 28245 Segmentation fault
 $HTTPD -k $ARGV




dmesg contains this message:

httpd[28245]: segfault at c ip b702020b sp bf84a000 error 4 in
mod_perl.so[b7001000+37000]





Here are the details of my configuration:

root@nas:~# perl -V
Summary of my perl5 (revision 5 version 18 subversion 1) configuration:

  Platform:
    osname=linux, osvers=3.10.9-smp, archname=i486-linux-thread-multi
    uname='linux hive 3.10.9-smp #1 smp wed aug 21 15:27:17 cdt 2013
i686 amd phenom(tm) ii x6 1100t processor authenticamd gnulinux '
    config_args='-de -Dprefix=/usr -Dsiteprefix=/usr/local
-Dsitelib=/usr/local/share/perl5 -Dsitearch=/usr/local/lib/perl5
-Darchlib=/usr/lib/perl5 -Dvendorprefix=/usr -Dprivlib=/usr/share/perl5
-Dvendorlib=/usr/share/perl5/vendor_perl
-Dvendorarch=/usr/lib/perl5/vendor_perl -Dscriptdir=/usr/bin
-Dcccdlflags=-fPIC -Dinstallprefix=/usr -Dlibpth=/usr/local/lib /usr/lib
/lib -Doptimize=-O2 -march=i486 -mtune=i686 -Dusethreads -Duseithreads
-Duseshrplib -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr
-Darchname=i486-linux'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing
-pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
    optimize='-O2 -march=i486 -mtune=i686',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.8.1', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib /lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.17.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.17'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/lib/perl5/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -march=i486 -mtune=i686
-L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl):
  Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
                        PERL_DONT_CREATE_GVSV
                        PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_ITHREADS
                        USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
                        USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO
                        USE_PERL_ATOF USE_REENTRANT_API
  Built under linux
  Compiled at Sep  5 2013 22:01:10
  @INC:
    /usr/local/lib/perl5
    /usr/local/share/perl5
    /usr/lib/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib/perl5
    /usr/share/perl5
    .




root@nas:~# /usr/local/apache2/bin/httpd -V
Server version: Apache/2.2.26 (Unix)
Server built:   Mar 21 2014 08:03:13
Server's Module Magic Number: 20051115:33
Server loaded:  APR 1.4.6, APR-Util 1.5.1
Compiled using: APR 1.4.6, APR-Util 1.5.1
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/usr/local/apache2"
 -D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"




root@nas:~# /usr/local/apache2/bin/httpd -M
Loaded Modules:
 core_module (static)
 authn_file_module (static)
 authn_default_module (static)
 authz_host_module (static)
 authz_groupfile_module (static)
 authz_user_module (static)
 authz_default_module (static)
 auth_basic_module (static)
 include_module (static)
 filter_module (static)
 log_config_module (static)
 env_module (static)
 setenvif_module (static)
 version_module (static)
 mpm_prefork_module (static)
 http_module (static)
 mime_module (static)
 status_module (static)
 autoindex_module (static)
 asis_module (static)
 cgi_module (static)
 negotiation_module (static)
 dir_module (static)
 actions_module (static)
 userdir_module (static)
 alias_module (static)
 so_module (static)
 perl_module (shared)
Syntax OK




root@nas:~# grep -v '^ *#' /usr/local/apache2/conf/httpd.conf
ServerRoot "/usr/local/apache2"

Listen 80

LoadModule perl_module modules/mod_perl.so

<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User daemon
Group daemon

</IfModule>
</IfModule>

ServerAdmin [email protected]

DocumentRoot "/usr/local/apache2/htdocs"

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Directory "/usr/local/apache2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

ErrorLog "logs/error_log"

LogLevel warn

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    CustomLog "logs/access_log" common

</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
</IfModule>

<IfModule cgid_module>
</IfModule>

<Directory "/usr/local/apache2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

DefaultType text/plain

<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
</IfModule>

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>


-- 
Paul Burton [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.