Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 105116 - mod_suPHP from portage crashs with segmentation fault
Summary: mod_suPHP from portage crashs with segmentation fault
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-06 23:40 UTC by Christian Güdel
Modified: 2006-06-05 06:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Güdel 2005-09-06 23:40:10 UTC
I installed mod_suPHP-0.6 together with php-cgi-5.0.4-r2 and apache-2.0.54-r14.
I'm enabling it with -D SUPHP. When I try to access a PHP scripted page like
<?php
   phpinfo();
?>
the apache child segfaults.


Reproducible: Always
Steps to Reproduce:
1. Install Apache2, php5-cgi, mod_suphp
2. copy a php script to the docroot, name it index.php
3. access the host and the child will segfault

Actual Results:  
segmentation fault of the apache child

Expected Results:  
It should deliver the php script in a secure way without segfaulting

Strace:
kladde ~ # strace -fp 24056
Process 24056 attached - interrupt to quit
select(0, NULL, NULL, NULL, {0, 380000}) = 0 (Timeout)
waitpid(-1, 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
waitpid(-1, 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
waitpid(-1, 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
waitpid(-1, 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
waitpid(-1, 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
select(0, NULL, NULL, NULL, {1, 0})     = ? ERESTARTNOHAND (To be restarted)
--- SIGCHLD (Child exited) @ 0 (0) ---
select(0, NULL, NULL, NULL, {0, 176000}) = 0 (Timeout)
fork(Process 24119 attached
)                                  = 24119
[pid 24056] waitpid(-1, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV}],
WNOHANG|WSTOPPED) = 24108
[pid 24119] getpid( <unfinished ...>
[pid 24056] gettimeofday( <unfinished ...>
[pid 24119] <... getpid resumed> )      = 24119
[pid 24056] <... gettimeofday resumed> {1126074919, 528166}, NULL) = 0
[pid 24119] rt_sigaction(SIGHUP, {0xb7d7cf00, [], SA_INTERRUPT},  <unfinished ...>
[pid 24056] write(6, "[Wed Sep 07 08:35:19 2005] [noti"..., 88 <unfinished ...>
[pid 24119] <... rt_sigaction resumed> {0xb7d7cf00, [HUP USR1], 0}, 8) = 0
[pid 24056] <... write resumed> )       = 88
[pid 24119] rt_sigaction(SIGTERM, {0xb7d7cf00, [], SA_INTERRUPT},  <unfinished ...>
[pid 24056] waitpid(-1,  <unfinished ...>
[pid 24119] <... rt_sigaction resumed> {0xb7d7cf00, [], 0}, 8) = 0
[pid 24056] <... waitpid resumed> 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
[pid 24119] rt_sigaction(SIGUSR1, {SIG_IGN},  <unfinished ...>
[pid 24056] select(0, NULL, NULL, NULL, {1, 0} <unfinished ...>
[pid 24119] <... rt_sigaction resumed> {0xb7d7cf00, [HUP USR1], 0}, 8) = 0
[pid 24119] getpid()                    = 24119
[pid 24119] getpid()                    = 24119
[pid 24119] brk(0x8188000)              = 0x8188000
[pid 24119] geteuid32()                 = 0
[pid 24119] setgid32(81)                = 0
[pid 24119] open("/proc/sys/kernel/ngroups_max", O_RDONLY) = 8
[pid 24119] read(8, "65536\n", 31)      = 6
[pid 24119] close(8)                    = 0
[pid 24119] open("/etc/group", O_RDONLY) = 8
[pid 24119] fcntl64(8, F_GETFD)         = 0
[pid 24119] fcntl64(8, F_SETFD, FD_CLOEXEC) = 0
[pid 24119] _llseek(8, 0, [0], SEEK_CUR) = 0
[pid 24119] fstat64(8, {st_mode=S_IFREG|0644, st_size=1045, ...}) = 0
[pid 24119] mmap2(NULL, 1045, PROT_READ, MAP_SHARED, 8, 0) = 0xb7bdb000
[pid 24119] _llseek(8, 1045, [1045], SEEK_SET) = 0
[pid 24119] fstat64(8, {st_mode=S_IFREG|0644, st_size=1045, ...}) = 0
[pid 24119] munmap(0xb7bdb000, 1045)    = 0
[pid 24119] close(8)                    = 0
[pid 24119] setgroups32(1, [81])        = 0
[pid 24119] geteuid32()                 = 0
[pid 24119] setuid32(81)                = 0
[pid 24119] getpid()                    = 24119
[pid 24119] accept(3,  <unfinished ...>
[pid 24056] <... select resumed> )      = 0 (Timeout)
[pid 24056] waitpid(-1, 0xbfefdcb0, WNOHANG|WSTOPPED) = 0
[pid 24056] select(0, NULL, NULL, NULL, {1, 0} <unfinished ...>
Process 24056 detached
Process 24119 detached

emerge info:
kladde ~ # emerge info
Portage 2.0.51.22-r2 (default-linux/x86/2005.1, gcc-3.3.5-20050130,
glibc-2.3.5-r1, 2.6.13-gentoo-kladde i686)
=================================================================
System uname: 2.6.13-gentoo-kladde i686 AMD Athlon(tm) XP 2000+
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://sunsite.cnlab-switch.ch/ftp/mirror/gentoo/"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 alsa apache2 apm arts avi bitmap-fonts crypt cups curl dedicated eds
emboss encode foomaticdb fortran gif gpm gstreamer imap imlib jpeg libg++ libwww
mad maildir mikmod motif mp3 mpeg mysql ncurses nls ogg oggvorbis oss pam
pam-mysql pdflib perl png python quicktime readline sasl sdl snmp spell ssl tcpd
truetype truetype-fonts type1-fonts vhosts vorbis xml2 xmms xv zlib userland_GNU
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS
Comment 1 Jochen Schalanda 2005-10-27 04:59:45 UTC
Having the same problem here, I could narrow it to the line

       AddDirectoryIndex index.php index.php5 index.php4 index.php3 index.phtml

in /etc/apache2/modules.d/70_mod_suphp.conf (or corresponding files). After
removing this line, Apache works again with mod_suphp. Could be an
incompatibility with the incremental mod_dir patch of net-www/apache.
Comment 2 Michael Stewart (vericgar) (RETIRED) gentoo-dev 2006-04-01 16:41:01 UTC
I have rewritten the patch that creates the AddDirectoryIndex directive. Can you upgrade to apache 2.0.55-r2 and see if that fixes the issue?
Comment 3 Luca Longinotti (RETIRED) gentoo-dev 2006-06-05 06:25:32 UTC
Works perfectly here with newer new-style Apache ebuilds (with vericgar's rewritten patch), mod_suPHP 0.6.1-r1 (only one in Portage now) and the new dev-lang/php ebuilds (4.4.2 and 5.1.4). The problem was AddDirectoryIndex it seems, and that was solved, and it works now, closing.
Best regards, CHTEKK.