Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] mod_perl segfaults, can't start Apache
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jmanko
Tux's lil' helper
Tux's lil' helper


Joined: 11 Sep 2005
Posts: 119
Location: NEPA, USA

PostPosted: Sat Jun 23, 2012 4:14 pm    Post subject: [SOLVED] mod_perl segfaults, can't start Apache Reply with quote

Code:
# /etc/init.d/apache2 start
 * Starting apache2 ...
 * start-stop-daemon: failed to start `/usr/sbin/apache2'


Code:
# dmesg
apache2[12697]: segfault at c ip b5d4974a sp bffce4d0 error 4 in mod_perl.so[b5d24000+45000]


Code:

# emerge --info mod_perl
Portage 2.1.11 (hardened/linux/x86, gcc-4.6.3, glibc-2.15-r2, 3.4.3-gentoo i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.4.3-gentoo-i686-Intel-R-_Celeron-R-_CPU_2.40GHz-with-gentoo-2.1
Timestamp of tree: Sat, 23 Jun 2012 07:45:01 +0000
ccache version 3.1.7 [disabled]
app-shells/bash:          4.2_p29
dev-java/java-config:     2.1.12
dev-lang/python:          2.6.8, 2.7.3-r2, 3.2.3-r1
dev-util/ccache:          3.1.7
dev-util/cmake:           2.8.8-r3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.10.3
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.12.1
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.4 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo godin java-overlay
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/sonar/conf /usr/share/maven-bin-3.0/conf"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-march=i686 -O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-march=i686 -O2 -pipe"
GENTOO_MIRRORS="http://www.gtlib.gatech.edu/pub/gentoo http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://cudlug.cudenver.edu/gentoo/ "
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/godin /var/lib/layman/java-overlay"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="acl berkdb bzip2 cli cracklib crypt cups cxx dri gdbm gpm hardened iconv modules mudflap ncurses nls nptl openmp pam pax_kernel pcre pic pppd readline session ssl tcpd unicode urandom x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

www-apache/mod_perl-2.0.7 was built with the following:
USE="debug"

_________________
"What stands in the way becomes the way." -- Marcus Aurelius


Last edited by jmanko on Thu Jun 28, 2012 2:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
gerdesj
l33t
l33t


Joined: 29 Sep 2005
Posts: 616
Location: Yeovil, Somerset, UK

PostPosted: Sat Jun 23, 2012 4:46 pm    Post subject: Re: mod_perl segfaults, can't start Apache Reply with quote

Not many details on how you got to this point. I can only suggest running perl-cleaner --all.

Cheers
Jon
Back to top
View user's profile Send private message
jmanko
Tux's lil' helper
Tux's lil' helper


Joined: 11 Sep 2005
Posts: 119
Location: NEPA, USA

PostPosted: Sat Jun 23, 2012 5:28 pm    Post subject: Re: mod_perl segfaults, can't start Apache Reply with quote

gerdesj wrote:
Not many details on how you got to this point. I can only suggest running perl-cleaner --all.

Cheers
Jon


Thanks for the feedback. I tried that, and it didn't work. Same error. How can I determine the root cause of the segfault? I don't know how gdb works, and apache doesn't have a "debug" USE flag. Running 'gdb /usr/sbin/apache2' doesn't tell me anything:

Code:
# gdb /usr/sbin/apache2
GNU gdb (Gentoo 7.4.1 p1) 7.4.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/sbin/apache2...(no debugging symbols found)...done.
(gdb)

_________________
"What stands in the way becomes the way." -- Marcus Aurelius
Back to top
View user's profile Send private message
jmanko
Tux's lil' helper
Tux's lil' helper


Joined: 11 Sep 2005
Posts: 119
Location: NEPA, USA

PostPosted: Mon Jun 25, 2012 4:52 pm    Post subject: Reply with quote

I still can't get this work. I tried replacing mod_perl with _mod_fastcgi, but I'm getting an error with that as well (though, I cna't determine the root cause).

Anyone else experiencing problems? Here is the apache install:

Code:
[ebuild   R    ] www-servers/apache-2.2.22-r1  USE="ssl threads -debug -doc -ldap (-selinux) -static -suexec" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -proxy_scgi -reqtimeout -substitute -version" APACHE2_MPMS="worker -event -itk -peruser -prefork" 0 kB

_________________
"What stands in the way becomes the way." -- Marcus Aurelius
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 5299
Location: Room 101

PostPosted: Mon Jun 25, 2012 5:40 pm    Post subject: Reply with quote

Jmanko ...

I think I see what your problem is ... apache has the 'threads' useflag set, when mod_perl requires -threads. The following is from a clean install (with USE="threads" in make.conf):

Code:
% emerge -pv mod_perl

These are the packages that would be merged, in order:

Calculating dependencies  . ... done!
[ebuild  N     ] app-admin/apache-tools-2.2.22  USE="ssl" 5,253 kB
[ebuild  N     ] virtual/perl-IO-Compress-2.024  0 kB
[ebuild  N     ] perl-core/CGI-3.510  237 kB
[ebuild  N     ] www-servers/apache-2.2.22-r1  USE="ssl -debug -doc -ldap (-selinux) -static -suexec -threads" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -proxy_scgi -reqtimeout -substitute -version" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 63 kB
[ebuild  N     ] virtual/perl-CGI-3.510  0 kB
[ebuild  N     ] dev-perl/Apache-Test-1.360.0  145 kB
[ebuild  N     ] www-apache/mod_perl-2.0.4-r1  3,641 kB
[ebuild  N     ] dev-perl/Apache-Reload-0.110.0  18 kB

Total: 8 packages (8 new), Size of downloads: 9,356 kB

The following USE changes are necessary to proceed:
#required by www-apache/mod_perl-2.0.4-r1, required by dev-perl/Apache-Reload-0.110.
=www-servers/apache-2.2.22-r1 -threads

So, set www-servers/apache -threads in /etc/portage/package.use and re-merge. It should then work as expected.

HTH & best ... khay
Back to top
View user's profile Send private message
jmanko
Tux's lil' helper
Tux's lil' helper


Joined: 11 Sep 2005
Posts: 119
Location: NEPA, USA

PostPosted: Mon Jun 25, 2012 6:12 pm    Post subject: Reply with quote

khayyam wrote:


I think I see what your problem is ... apache has the 'threads' useflag set, when mod_perl requires -threads. The following is from a clean install (with USE="threads" in make.conf):
......

HTH & best ... khay


Well, perl is compiled with ithreads, and apache threads is required for php5, I believe.

I did an strace, and here is what I get. Though, I'm not sure how to interpret all of this...

Code:
 
# strace -x /usr/sbin/apache2 > /root/apache_strace

[ output removed ] .....

stat64("/etc/apache2/modules.d/75_mod_perl.conf", {st_mode=S_IFREG|0644, st_size=1406, ...}) = 0
open("/etc/apache2/modules.d/75_mod_perl.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=1406, ...}) = 0
brk(0xb7848000)                         = 0xb7848000
read(4, "<IfDefine PERL>\nLoadModule perl_"..., 4096) = 1406
read(4, "", 4096)                       = 0
close(4)                                = 0
stat64("/etc/apache2/vhosts.d", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
openat(AT_FDCWD, "/etc/apache2/vhosts.d", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 4
getdents64(4, /* 6 entries */, 32768)   = 240
getdents64(4, /* 0 entries */, 32768)   = 0
close(4)                                = 0
stat64("/etc/apache2/vhosts.d/00_default_ssl_vhost.conf", {st_mode=S_IFREG|0644, st_size=7824, ...}) = 0
open("/etc/apache2/vhosts.d/00_default_ssl_vhost.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=7824, ...}) = 0
read(4, "<IfDefine SSL>\n<IfDefine SSL_DEF"..., 4096) = 4096
read(4, "means that the\n\t# standard Auth/"..., 4096) = 3728
read(4, "", 4096)                       = 0
close(4)                                = 0
stat64("/etc/apache2/vhosts.d/00_default_vhost.conf", {st_mode=S_IFREG|0644, st_size=1520, ...}) = 0
open("/etc/apache2/vhosts.d/00_default_vhost.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=1520, ...}) = 0
read(4, "# Virtual Hosts\n#\n# If you want "..., 4096) = 1520
read(4, "", 4096)                       = 0
close(4)                                = 0
read(3, "", 4096)                       = 0
close(3)                                = 0
brk(0xb7869000)                         = 0xb7869000
stat64("/usr/sbin/suexec", 0xbf9234e0)  = -1 ENOENT (No such file or directory)
gettimeofday({1340647469, 246523}, NULL) = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3
brk(0xb788a000)                         = 0xb788a000
fstat64(3, {st_mode=S_IFREG|0644, st_size=508, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb76be000
read(3, "# /etc/nsswitch.conf:\n# $Header:"..., 4096) = 508
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0xb76be000, 4096)                = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=42614, ...}) = 0
mmap2(NULL, 42614, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb67bc000
close(3)                                = 0
open("/lib/libnss_compat.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00\x90\x10\x00\x00\x34\x00\x00\x00"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=34296, ...}) = 0
mmap2(NULL, 37300, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb5db6000
mmap2(0xb5dbe000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7) = 0xb5dbe000
close(3)                                = 0
mprotect(0xb5dbe000, 4096, PROT_READ)   = 0
munmap(0xb67bc000, 42614)               = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=42614, ...}) = 0
mmap2(NULL, 42614, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb67bc000
close(3)                                = 0
open("/lib/libnss_nis.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00\x90\x1e\x00\x00\x34\x00\x00\x00"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=42284, ...}) = 0
mmap2(NULL, 45448, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb5daa000
mmap2(0xb5db4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9) = 0xb5db4000
close(3)                                = 0
open("/lib/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00\x90\x1f\x00\x00\x34\x00\x00\x00"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=50784, ...}) = 0
mmap2(NULL, 54120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb5d9c000
mmap2(0xb5da8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb) = 0xb5da8000
close(3)                                = 0
mprotect(0xb5da8000, 4096, PROT_READ)   = 0
mprotect(0xb5db4000, 4096, PROT_READ)   = 0
munmap(0xb67bc000, 42614)               = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
fcntl64(3, F_GETFD)                     = 0x1 (flags FD_CLOEXEC)
_llseek(3, 0, [0], SEEK_CUR)            = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=1567, ...}) = 0
mmap2(NULL, 1567, PROT_READ, MAP_SHARED, 3, 0) = 0xb76be000
_llseek(3, 1567, [1567], SEEK_SET)      = 0
munmap(0xb76be000, 1567)                = 0
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/etc/group", O_RDONLY|O_CLOEXEC)  = 3
_llseek(3, 0, [0], SEEK_CUR)            = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=683, ...}) = 0
mmap2(NULL, 683, PROT_READ, MAP_SHARED, 3, 0) = 0xb76be000
_llseek(3, 683, [683], SEEK_SET)        = 0
munmap(0xb76be000, 683)                 = 0
close(3)                                = 0
gettimeofday({1340647469, 259054}, NULL) = 0
brk(0xb78ab000)                         = 0xb78ab000
gettimeofday({1340647469, 259689}, NULL) = 0
write(2, "no listening sockets available, "..., 46no listening sockets available, shutting down
) = 46
write(2, "Unable to open logs\n", 20Unable to open logs
)   = 20
select(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)
munmap(0xb67dd000, 9945604)             = 0
munmap(0xb67c7000, 86036)               = 0
munmap(0xb677e000, 253156)              = 0
munmap(0xb6731000, 313700)              = 0
munmap(0xb64a1000, 406576)              = 0
munmap(0xb6470000, 200416)              = 0
munmap(0xb6465000, 41020)               = 0
munmap(0xb6418000, 312336)              = 0
munmap(0xb63cf000, 295656)              = 0
munmap(0xb63bf000, 61628)               = 0
munmap(0xb63a8000, 91976)               = 0
munmap(0xb634c000, 376128)              = 0
munmap(0xb62b0000, 634892)              = 0
munmap(0xb6282000, 184332)              = 0
munmap(0xb622b000, 352356)              = 0
munmap(0xb621a000, 68648)               = 0
munmap(0xb5f49000, 1573892)             = 0
munmap(0xb66b4000, 404972)              = 0
munmap(0xb5e86000, 797648)              = 0
munmap(0xb6505000, 1762536)             = 0
munmap(0xb5e4b000, 237764)              = 0
munmap(0xb60ca000, 1374740)             = 0
munmap(0xb5dc5000, 548812)              = 0
munmap(0xb5dc0000, 16396)               = 0
munmap(0xb715a000, 12400)               = 0
munmap(0xb715e000, 16480)               = 0
munmap(0xb7163000, 12432)               = 0
munmap(0xb7167000, 16480)               = 0
munmap(0xb716c000, 16480)               = 0
munmap(0xb7171000, 65664)               = 0
munmap(0xb7182000, 36960)               = 0
munmap(0xb718c000, 25008)               = 0
munmap(0xb7193000, 20580)               = 0
munmap(0xb7199000, 12396)               = 0
munmap(0xb719d000, 28992)               = 0
munmap(0xb71a5000, 45164)               = 0
munmap(0xb71b1000, 20584)               = 0
munmap(0xb71b7000, 16480)               = 0
munmap(0xb71bc000, 24676)               = 0
munmap(0xb71c3000, 12384)               = 0
munmap(0xb71e1000, 12384)               = 0
munmap(0xb71e5000, 12384)               = 0
munmap(0xb71e9000, 24672)               = 0
munmap(0xb71c7000, 90184)               = 0
munmap(0xb71f0000, 32908)               = 0
munmap(0xb71f9000, 24688)               = 0
munmap(0xb7200000, 36964)               = 0
munmap(0xb720a000, 8288)                = 0
munmap(0xb720d000, 12384)               = 0
munmap(0xb7211000, 12388)               = 0
munmap(0xb7215000, 12384)               = 0
munmap(0xb7219000, 8288)                = 0
munmap(0xb721c000, 12384)               = 0
munmap(0xb7220000, 12384)               = 0
munmap(0xb7224000, 8288)                = 0
munmap(0xb7227000, 12384)               = 0
munmap(0xb722b000, 8288)                = 0
munmap(0xb722e000, 12384)               = 0
munmap(0xb7232000, 12384)               = 0
munmap(0xb76bf000, 16480)               = 0
munmap(0xb76c4000, 12384)               = 0
exit_group(1)                           = ?
+++ exited with 1 +++

_________________
"What stands in the way becomes the way." -- Marcus Aurelius
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 5299
Location: Room 101

PostPosted: Mon Jun 25, 2012 7:48 pm    Post subject: Reply with quote

jmanko wrote:
Well, perl is compiled with ithreads, and apache threads is required for php5, I believe.

jmanko ... I see ...

jmanko wrote:
Code:
connect(3, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)

Is nscd running? ... /etc/init.d/nscd status

best ... khay
Back to top
View user's profile Send private message
jmanko
Tux's lil' helper
Tux's lil' helper


Joined: 11 Sep 2005
Posts: 119
Location: NEPA, USA

PostPosted: Mon Jun 25, 2012 10:16 pm    Post subject: Reply with quote

It wasn't running, but I changed that and added to default rc. I recompiled apache with suexec support (because I noticed a missing suexec ref in the output). Unfortunately, I'm getting the same error output.

The command I'm using now is:

Code:
# strace  -fx /usr/sbin/apache2 -X


From the point where mod_perl confi is detected:

Code:

stat64("/etc/apache2/modules.d/75_mod_perl.conf", {st_mode=S_IFREG|0644, st_size=1406, ...}) = 0
open("/etc/apache2/modules.d/75_mod_perl.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=1406, ...}) = 0
brk(0xb7810000)                         = 0xb7810000
read(4, "<IfDefine PERL>\nLoadModule perl_"..., 4096) = 1406
read(4, "", 4096)                       = 0
close(4)                                = 0
stat64("/etc/apache2/vhosts.d", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
openat(AT_FDCWD, "/etc/apache2/vhosts.d", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 4
getdents64(4, /* 6 entries */, 32768)   = 240
getdents64(4, /* 0 entries */, 32768)   = 0
close(4)                                = 0
stat64("/etc/apache2/vhosts.d/00_default_ssl_vhost.conf", {st_mode=S_IFREG|0644, st_size=7824, ...}) = 0
open("/etc/apache2/vhosts.d/00_default_ssl_vhost.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=7824, ...}) = 0
read(4, "<IfDefine SSL>\n<IfDefine SSL_DEF"..., 4096) = 4096
read(4, "means that the\n\t# standard Auth/"..., 4096) = 3728
read(4, "", 4096)                       = 0
close(4)                                = 0
stat64("/etc/apache2/vhosts.d/00_default_vhost.conf", {st_mode=S_IFREG|0644, st_size=1520, ...}) = 0
open("/etc/apache2/vhosts.d/00_default_vhost.conf", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=1520, ...}) = 0
read(4, "# Virtual Hosts\n#\n# If you want "..., 4096) = 1520
read(4, "", 4096)                       = 0
close(4)                                = 0
read(3, "", 4096)                       = 0
close(3)                                = 0
brk(0xb7831000)                         = 0xb7831000
stat64("/usr/sbin/suexec", {st_mode=S_IFREG|S_ISUID|0710, st_size=13588, ...}) = 0
gettimeofday({1340661900, 952340}, NULL) = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = 0
send(3, "\x02\x00\x00\x00\x0b\x00\x00\x00\x07\x00\x00\x00\x70\x61\x73\x73\x77\x64\x00", 19, MSG_NOSIGNAL) = 19
poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 ([{fd=3, revents=POLLIN|POLLHUP}])
recvmsg(3, {msg_name(0)=NULL, msg_iov(2)=[{"", 7}, {"", 8}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 0
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = 0
send(3, "\x02\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x61\x70\x61\x63\x68\x65\x00", 19, MSG_NOSIGNAL) = 19
poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 ([{fd=3, revents=POLLIN|POLLHUP}])
read(3, "\x02\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x02\x00\x00\x00\x51\x00\x00\x00\x51\x00\x00\x00\x1c\x00\x00\x00\x09\x00\x00\x00"..., 36) = 36
read(3, "\x61\x70\x61\x63\x68\x65\x00\x78\x00\x61\x64\x64\x65\x64\x20\x62\x79\x20\x70\x6f\x72\x74\x61\x67\x65\x20\x66\x6f\x72\x20\x61\x70"..., 60) = 60
close(3)                                = 0
brk(0xb7852000)                         = 0xb7852000
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = 0
send(3, "\x02\x00\x00\x00\x0c\x00\x00\x00\x06\x00\x00\x00\x67\x72\x6f\x75\x70\x00", 18, MSG_NOSIGNAL) = 18
poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 ([{fd=3, revents=POLLIN|POLLHUP}])
recvmsg(3, {msg_name(0)=NULL, msg_iov(2)=[{"", 6}, {"", 8}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 0
close(3)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3
connect(3, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = 0
send(3, "\x02\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x61\x70\x61\x63\x68\x65\x00", 19, MSG_NOSIGNAL) = 19
poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 ([{fd=3, revents=POLLIN|POLLHUP}])
read(3, "\x02\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00\x02\x00\x00\x00\x51\x00\x00\x00\x00\x00\x00\x00", 24) = 24
read(3, "\x61\x70\x61\x63\x68\x65\x00\x78\x00", 9) = 9
close(3)                                = 0
gettimeofday({1340661900, 959027}, NULL) = 0
brk(0xb7874000)                         = 0xb7874000
gettimeofday({1340661900, 959740}, NULL) = 0
write(2, "no listening sockets available, "..., 46no listening sockets available, shutting down
) = 46
write(2, "Unable to open logs\n", 20Unable to open logs
)   = 20
select(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)
munmap(0xb67a3000, 9945604)             = 0
munmap(0xb678d000, 86036)               = 0
munmap(0xb6744000, 253156)              = 0
munmap(0xb66f7000, 313700)              = 0
munmap(0xb6467000, 406576)              = 0
munmap(0xb6436000, 200416)              = 0
munmap(0xb642b000, 41020)               = 0
munmap(0xb63de000, 312336)              = 0
munmap(0xb6395000, 295656)              = 0
munmap(0xb6385000, 61628)               = 0
munmap(0xb636e000, 91976)               = 0
munmap(0xb6312000, 376128)              = 0
munmap(0xb6276000, 634892)              = 0
munmap(0xb6248000, 184332)              = 0
munmap(0xb61f1000, 352356)              = 0
munmap(0xb61e0000, 68648)               = 0
munmap(0xb5f0f000, 1573892)             = 0
munmap(0xb667a000, 404972)              = 0
munmap(0xb66dd000, 104008)              = 0
munmap(0xb5e4c000, 797648)              = 0
munmap(0xb64cb000, 1762536)             = 0
munmap(0xb5e11000, 237764)              = 0
munmap(0xb6090000, 1374740)             = 0
munmap(0xb5d8b000, 548812)              = 0
munmap(0xb5d86000, 16396)               = 0
munmap(0xb7120000, 12400)               = 0
munmap(0xb7124000, 16480)               = 0
munmap(0xb7129000, 12432)               = 0
munmap(0xb712d000, 16480)               = 0
munmap(0xb7132000, 16480)               = 0
munmap(0xb7137000, 65664)               = 0
munmap(0xb7148000, 32864)               = 0
munmap(0xb7151000, 25008)               = 0
munmap(0xb7158000, 20580)               = 0
munmap(0xb715e000, 12396)               = 0
munmap(0xb7162000, 28992)               = 0
munmap(0xb716a000, 45164)               = 0
munmap(0xb7176000, 20584)               = 0
munmap(0xb717c000, 20576)               = 0
munmap(0xb7182000, 24676)               = 0
munmap(0xb7189000, 12384)               = 0
munmap(0xb71a7000, 12384)               = 0
munmap(0xb71ab000, 12384)               = 0
munmap(0xb71af000, 24672)               = 0
munmap(0xb718d000, 90184)               = 0
munmap(0xb71b6000, 37004)               = 0
munmap(0xb71c0000, 24688)               = 0
munmap(0xb71c7000, 36964)               = 0
munmap(0xb71d1000, 8288)                = 0
munmap(0xb71d4000, 12384)               = 0
munmap(0xb71d8000, 12388)               = 0
munmap(0xb71dc000, 12384)               = 0
munmap(0xb71e0000, 8288)                = 0
munmap(0xb71e3000, 12384)               = 0
munmap(0xb71e7000, 12384)               = 0
munmap(0xb71eb000, 8288)                = 0
munmap(0xb71ee000, 12384)               = 0
munmap(0xb71f2000, 8288)                = 0
munmap(0xb71f5000, 12384)               = 0
munmap(0xb71f9000, 12384)               = 0
munmap(0xb7686000, 16480)               = 0
munmap(0xb768b000, 12384)               = 0
brk(0xb7852000)                         = 0xb7852000
exit_group(1)                           = ?
+++ exited with 1 +++

_________________
"What stands in the way becomes the way." -- Marcus Aurelius
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 5299
Location: Room 101

PostPosted: Mon Jun 25, 2012 11:11 pm    Post subject: Reply with quote

jmanko ... well, everything looks ok until this:

jmanko wrote:
Code:
write(2, "no listening sockets available, "..., 46no listening sockets available, shutting down

Are you sure that apache (or something) isn't running on whatever port you've supplied, what does 'lsof -i' show? Also, who are you running this as, only root will be able to bind to a port. This is generally what the above error will point to. I assume you tried to start using /etc/init.d before the strace, so I don't want to sound like I'm stating the obvious, but not being able to bind to a port is generally due to either something already bound, privillage, or 'Listen' defined more than once in the httpd.conf (or files referenced by it).

HTH & best ...

khay
Back to top
View user's profile Send private message
jmanko
Tux's lil' helper
Tux's lil' helper


Joined: 11 Sep 2005
Posts: 119
Location: NEPA, USA

PostPosted: Tue Jun 26, 2012 5:37 am    Post subject: Reply with quote

Well, I grep'd all apache config files, and only two Listen directives exist, one for 443 and one for 80, both different vhosts.

Code:
# lsof -i -n -P
COMMAND    PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
mysqld   13077 mysql   11u  inet   8762      0t0  TCP 127.0.0.1:3306 (LISTEN)
mysqld   13077 mysql   32u  inet  14516      0t0  TCP 127.0.0.1:3306->127.0.0.1:38201 (ESTABLISHED)
mysqld   13077 mysql   34u  inet  10103      0t0  TCP 127.0.0.1:3306->127.0.0.1:38197 (ESTABLISHED)
mysqld   13077 mysql   35u  inet  10185      0t0  TCP 127.0.0.1:3306->127.0.0.1:38198 (ESTABLISHED)
sshd     13147  root    3u  inet   8882      0t0  TCP *:22 (LISTEN)
apcupsd  13209  root    6u  inet   9041      0t0  TCP *:3551 (LISTEN)
ntpd     13311  root   16u  inet   9215      0t0  UDP *:123
ntpd     13311  root   17u  inet   9219      0t0  UDP 127.0.0.1:123
ntpd     13311  root   18u  inet   9220      0t0  UDP 192.168.1.145:123
smbd     13325  root   29u  inet   9325      0t0  TCP *:445 (LISTEN)
smbd     13325  root   30u  inet   9327      0t0  TCP *:139 (LISTEN)
nmbd     13332  root    9u  inet   9350      0t0  UDP *:137
nmbd     13332  root   10u  inet   9351      0t0  UDP *:138
nmbd     13332  root   11u  inet   9353      0t0  UDP 192.168.1.145:137
nmbd     13332  root   12u  inet   9354      0t0  UDP 192.168.1.255:137
nmbd     13332  root   13u  inet   9355      0t0  UDP 192.168.1.145:138
nmbd     13332  root   14u  inet   9356      0t0  UDP 192.168.1.255:138
sendmail 13348  root    4u  inet   9436      0t0  TCP *:25 (LISTEN)
sendmail 13348  root    5u  inet   9437      0t0  TCP *:587 (LISTEN)
snmpd    13368  root    8u  inet   9602      0t0  UDP 127.0.0.1:161
snmpd    13368  root    9u  inet   9601      0t0  UDP *:44979
snmpd    13368  root   10u  inet   9606      0t0  TCP 127.0.0.1:705 (LISTEN)
wrapper  13425 sonar    7u  inet   9991      0t0  TCP 127.0.0.1:32000->127.0.0.1:31000 (ESTABLISHED)
java     13427 sonar    4u  inet   9679      0t0  TCP 127.0.0.1:32000 (LISTEN)
svnserve 13456   svn    3u  inet   9916      0t0  TCP *:3690 (LISTEN)
sshd     13530  root    3u  inet  10025      0t0  TCP 192.168.1.145:22->192.168.1.128:52324 (ESTABLISHED)


I'm not sure what you mean by running /etc/init.d first. If you mean running apache from "/etc/init.d/apach2 start" then no, until now, but there is so much output I wouldn't even know where to begin to cut and paste.

The thing is, Apache starts when I remove mod_perl support. Obviously, it has something to do with the module.

Anyway, here is the tail end of the output using strace with the init script. It's interesting to note the Interrupted system call below. Not sure what significance that has, though. I really link to a file with the entire output. What do you think?

Code:
[pid 15152] +++ exited with 0 +++
<... poll resumed> )                    = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=15152, si_status=0, si_utime=1, si_stime=7} ---
write(5, "\x11\x00\x00\x00", 4)         = 4
sigreturn() (mask [])                   = -1 EINTR (Interrupted system call)
poll([{fd=4, events=POLLIN}], 1, -1)    = 1 ([{fd=4, revents=POLLIN}])
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
close(4)                                = 0
close(5)                                = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
waitpid(15152, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 15152
stat64("/run/openrc/started/apache2", 0xbff482f0) = -1 ENOENT (No such file or directory)
stat64("/run/openrc/stopped/apache2", 0xbff482f0) = -1 ENOENT (No such file or directory)
stat64("/run/openrc/starting/apache2", {st_mode=S_IFREG|0755, st_size=4884, ...}) = 0
stat64("/run/openrc/stopping/apache2", 0xbff482f0) = -1 ENOENT (No such file or directory)
stat64("/run/openrc/inactive/apache2", 0xbff482f0) = -1 ENOENT (No such file or directory)
stat64("/run/openrc/wasinactive/apache2", 0xbff482f0) = -1 ENOENT (No such file or directory)
stat64("/run/openrc/hotplugged/apache2", 0xbff482f0) = -1 ENOENT (No such file or directory)
stat64("/run/openrc/failed/apache2", 0xbff482f0) = -1 ENOENT (No such file or directory)
stat64("/run/openrc/scheduled/apache2", 0xbff482f0) = -1 ENOENT (No such file or directory)
stat64("/etc/init.d/apache2", {st_mode=S_IFREG|0755, st_size=4884, ...}) = 0
stat64("/run/openrc/started/apache2", 0xbff472e0) = -1 ENOENT (No such file or directory)
symlink("/etc/init.d/apache2", "/run/openrc/started/apache2") = 0
stat64("/run/openrc/starting/apache2", {st_mode=S_IFREG|0755, st_size=4884, ...}) = 0
unlink("/run/openrc/starting/apache2")  = 0
stat64("/run/openrc/stopping/apache2", 0xbff472e0) = -1 ENOENT (No such file or directory)
stat64("/run/openrc/inactive/apache2", 0xbff472e0) = -1 ENOENT (No such file or directory)
stat64("/run/openrc/wasinactive/apache2", 0xbff472e0) = -1 ENOENT (No such file or directory)
stat64("/run/openrc/failed/apache2", 0xbff472e0) = -1 ENOENT (No such file or directory)
unlink("/run/openrc/exclusive/apache2") = 0
openat(AT_FDCWD, "/run/openrc/scheduled", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 4
getdents(4, /* 2 entries */, 32768)     = 32
getdents(4, /* 0 entries */, 32768)     = 0
close(4)                                = 0
close(3)                                = 0
unlink("/run/openrc/exclusive/apache2") = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/openrc/scheduled/apache2", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
exit_group(0)                           = ?
+++ exited with 0 +++

_________________
"What stands in the way becomes the way." -- Marcus Aurelius
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 5299
Location: Room 101

PostPosted: Tue Jun 26, 2012 11:39 pm    Post subject: Reply with quote

jmanko ...

jmanko wrote:
I'm not sure what you mean by running /etc/init.d first. If you mean running apache from "/etc/init.d/apach2 start" then no, until now, but there is so much output I wouldn't even know where to begin to cut and paste.

I'd ment that the only reasons I could see for why it wasn't able to bind to a port would be 1). something is already bound, 2). the privilages of the user running not being able to bind and 3). conflicting or duplicate entries for 'Listen'. If your running strace then its obviously not via /etc/init.d, so I was asking to cover point 2.

jmanko wrote:
The thing is, Apache starts when I remove mod_perl support. Obviously, it has something to do with the module.

Well, it might also be a perl module, not all modules are thread safe ... I know that DBD::Mysql isn't/wasn't and caused some issues (I'm thinking circa 2010).

jmanko wrote:
Anyway, here is the tail end of the output using strace with the init script. It's interesting to note the Interrupted system call below. Not sure what significance that has, though. I really link to a file with the entire output. What do you think?

I'm not entirely sure what I'm looking at ... this could just be a parent having told pid 15152 (a child) to die (which it does) and moves on to the next ... and the missing run files were perhaps never created (the process having died young).

best ... khay
Back to top
View user's profile Send private message
jmanko
Tux's lil' helper
Tux's lil' helper


Joined: 11 Sep 2005
Posts: 119
Location: NEPA, USA

PostPosted: Tue Jun 26, 2012 11:46 pm    Post subject: Reply with quote

I feel so dumb, ha. Ok, I'm going to check everything that you've mentioned slowly and carefully. Hopefully it will be something you mentioned. Thanks. I'll report back.
_________________
"What stands in the way becomes the way." -- Marcus Aurelius
Back to top
View user's profile Send private message
zeek
Guru
Guru


Joined: 16 Nov 2002
Posts: 479
Location: Bantayan Island

PostPosted: Wed Jun 27, 2012 6:49 am    Post subject: Reply with quote

I believe I use Apache with the prefork MPM running mod_perl and php with no stability problems. You seem to have prefork disabled:

Code:

APACHE2_MPMS="worker -event -itk -peruser -prefork"
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 5299
Location: Room 101

PostPosted: Wed Jun 27, 2012 12:30 pm    Post subject: Reply with quote

zeek wrote:
I believe I use Apache with the prefork MPM running mod_perl and php with no stability problems. You seem to have prefork disabled

The mod_perl 2.0 prequisites does list prefork, so your probably right in this regard.

best ... khay
Back to top
View user's profile Send private message
jmanko
Tux's lil' helper
Tux's lil' helper


Joined: 11 Sep 2005
Posts: 119
Location: NEPA, USA

PostPosted: Wed Jun 27, 2012 7:22 pm    Post subject: Reply with quote

Well, I'm been running mod_perl without prefork without problems in the past. Additionally, threads is needed for php, correct? When trying to build apache with prefork, I get a build error because of the "threads" USE flag.

Code:
>>> Failed to emerge www-servers/apache-2.2.22-r1, Log file:

>>>  '/var/tmp/portage/www-servers/apache-2.2.22-r1/temp/build.log'

 * Messages for package www-servers/apache-2.2.22-r1:

 *
 * Selected MPM: prefork
 *
 * You have selected a non-threaded MPM but USE=threads is enabled
 * ERROR: www-servers/apache-2.2.22-r1 failed (setup phase):
 *   invalid use flag combination


Also, the prereqs don't state that prefork is required. It states that in order to use prefork you need Perl 5.6.1 or greater.
_________________
"What stands in the way becomes the way." -- Marcus Aurelius
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Wed Jun 27, 2012 7:43 pm    Post subject: Reply with quote

jmanko,
Try www-servers/apache -threads in package.use
_________________
Good luck :wink:

Since installing gentoo, my life has become one long emerge :)
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 5299
Location: Room 101

PostPosted: Wed Jun 27, 2012 9:25 pm    Post subject: Reply with quote

jmanko wrote:
Also, the prereqs don't state that prefork is required. It states that in order to use prefork you need Perl 5.6.1 or greater.

Yes, your right ... at a glance I saw "prequsites:" bullet list "Prefork MPM".

best ... khay
Back to top
View user's profile Send private message
jmanko
Tux's lil' helper
Tux's lil' helper


Joined: 11 Sep 2005
Posts: 119
Location: NEPA, USA

PostPosted: Thu Jun 28, 2012 2:37 pm    Post subject: Reply with quote

Ok, I figured it out. Actually, someone from the mod_perl mailing list figured it out! :) The problem was related to the -D_FILE_OFFSET_BITS=64 option not being included with the mod_perl build. Here is what he said:

Code:
On Wed, Jun 27, 2012 at 6:00 PM, Christopher Hall wrote:

    I've been seeing the same problem on Gentoo.  I think this is the same
    issue as described at
    http://www.gossamer-threads.com/lists/perl/porters/263222 .

    When perl is compiled, the optimisation switches in the CFLAGS in
    make.conf are used, together with some autodetected ones.  When perl
    modules, such as mod_perl, are built later, the CFLAGS from the
    currently-installed perl are extracted, and used by themselves,
    without the autodetected ones.

    In this case, the perl compilation was using my CFLAGS, together with
    -D_FILE_OFFSET_BITS=64 (among other things).  But mod_perl (and all
    other perl modules written in C) are only picking up the CFLAGS.  This
    causes a difference in ABI, and hence the crash.

    If I add -D_FILE_OFFSET_BITS=64 to the end of my CFLAGS in make.conf,
    and recompile perl, then this define still gets added to the compiler
    switches -- where it does no harm being specified twice.  If I then
    recompile mod_perl, this now includes that switch, after which
    everything works fine.

    I've since created /etc/portage/env/dev-lang/perl with
    CFLAGS="$(CFLAGS) -D_FILE_OFFSET_BITS=64" to save having to alter the
    make.conf globally.  This approach ought to be sufficient, but I
    haven't had chance to test it.



I used the package env config as described in the Gentoo Wiki (http://wiki.gentoo.org/wiki//etc/portage/env). For those having this problem, simply create the following files and rebuild perl and mod_perl

/etc/portage/env/www-apache_mod_perl.conf:
CFLAGS="${CFLAGS} -D_FILE_OFFSET_BITS=64"

/etc/portage/package.env:
www-apache/mod_perl www-apache_mod_perl.conf
dev-lang/perl www-apache_mod_perl.conf

Now, I wasn't sure if adding the www-apache/mod_perl was required or not, but I included it anyway.

So, mod_perl builds fine and apache is running. I have other problems related to Bugzilla and perl modules, but I don't think it's related. I will follow up if it is.

Thank you, everyone for your help!
_________________
"What stands in the way becomes the way." -- Marcus Aurelius
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 5299
Location: Room 101

PostPosted: Thu Jun 28, 2012 2:52 pm    Post subject: Reply with quote

jmanko ...

good to hear you've it figured out ... I have to say that I don't think I would have traced it to CFLAGS as I generally assume the build will be correct, or at least, if not, reported on bugzilla ... which should probably now do.

best ... khay
Back to top
View user's profile Send private message
ceric35
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2006
Posts: 113

PostPosted: Thu Dec 19, 2013 10:33 am    Post subject: Reply with quote

I'm currently experiencing this issue.

After searching a solution for days, the /etc/portage/env/www-apache_mod_perl.conf, /etc/portage/package.env solution fixed it.
Back to top
View user's profile Send private message
moodboom
n00b
n00b


Joined: 06 Aug 2007
Posts: 21

PostPosted: Thu Jan 16, 2014 5:41 am    Post subject: Reply with quote

Kick ass, this fixed my mod_perl segfault too. I would have NEVER figured this one out on my own, thanks so much, saved me days of time.

Warning: make sure you compile BOTH PERL AND MOD_PERL after configuring the package settings.
Back to top
View user's profile Send private message
Wizor
n00b
n00b


Joined: 02 May 2016
Posts: 2

PostPosted: Mon May 02, 2016 8:44 pm    Post subject: Same here Reply with quote

Likewise. Really yanked my noodles this one and good thing i stumbled upon this solution. Much appreciated! :)

-W
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum