Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 240264 - www-servers/apache-2.2.9-r1 + >=dev-libs/apr{,-util}-1.3 segfaults with PHP and DBD/MySQL
Summary: www-servers/apache-2.2.9-r1 + >=dev-libs/apr{,-util}-1.3 segfaults with PHP a...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High normal with 2 votes (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
: 249596 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-06 13:07 UTC by Anthony Sowden
Modified: 2010-07-18 13:03 UTC (History)
6 users (show)

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


Attachments
patch for php 5.2.11 (force_libmysqlclient_r.patch,603 bytes, patch)
2009-10-25 20:20 UTC, Philip Taffner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Sowden 2008-10-06 13:07:10 UTC
Apache 2.2.9-r1 and apr-1.3.2 and apr-util-1.3.2 seg faults if both PHP and mod_dbd/mysql are enabled.  There is no problem if only one of these are enabled.  There is no problem if apr/apr-util are downgraded to 1.2.X.

Steps to reproduce:
1. Build apache with at least mod_dbd and mod_authn_dbd
2. Build php with at least mysql and mysqli support
3. With default httpd.conf and vhosts.d/*, and -D PHP enabled: apache starts and runs OK
4. Add "DBDriver mysql" statement to apache configuration: seg fault in apache syntax check (-t)
5. Remove -D PHP from conf.d/apache => apache starts and runs OK

This behaviour seen in two different systems, one hardenned, one normal.

On normal system, PHP re-built with debug use flag, and apache run under gdb.

# Apache configuration contains "DBDriver mysql" statement
(gdb) run -D SSL -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -t
Syntax OK
Program exited normally

(gdb) run -D PHP5 -D SSL -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -t
Syntax OK
Program received signal SIGSEGV, Segmentation fault.
0xb6f958f0 in ?? ()
(gdb) bt
#0  0xb6f958f0 in ?? ()
#1  0xb6e41384 in ?? () from /usr/lib/apr-util-1/apr_dbd_mysql-1.so
#2  0x00000002 in ?? ()
#3  0xb6e41376 in ?? () from /usr/lib/apr-util-1/apr_dbd_mysql-1.so
#4  0xb7db8ff4 in ?? () from /usr/lib/libapr-1.so.0
#5  0xb7da902d in ?? () from /usr/lib/libapr-1.so.0
#6  0x00000000 in ?? ()

Seg fault occurs with apr/apr-util versions 1.3.0, 1.3.2 and 1.3.3/4.  Downgrading to 1.2.X eliminates the problem.

The position of the DBDriver statement does not affect the seg fault: either in the main server config, or a virtual server config.

Apache-2.2.9-r1 and apr-1.2.11 and apr-util-1.2.10 works fine: mod_authn_dbd correctly authenticates against a mysql database, and php correctly accesses the same mysql database.

This problem, or a very similar one, has been reported in Gentoo Forums:
http://forums.gentoo.org/viewtopic-t-707991-highlight-apache.html

The poster found a bug submitted to PHP:
http://bugs.php.net/bug.php?id=45995

The PHP bug report has a different backtrace, but otherwise the symptoms are very similar.  This report led me to try first without PHP, and then with an earlier release of apr.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-10-06 19:42:28 UTC
Please post your `emerge --info' too.
Comment 2 Anthony Sowden 2008-10-07 07:36:14 UTC
(In reply to comment #1)
> Please post your `emerge --info' too.

Portage 2.1.4.4 (hardened/x86/2.6, gcc-3.4.6, glibc-2.6.1-r0, 2.6.9-023stab040.1-smp i686)
=================================================================
System uname: 2.6.9-023stab040.1-smp i686 Intel(R) Pentium(R) 4 CPU 3.06GHz
Timestamp of tree: Tue, 02 Sep 2008 13:34:01 +0000
app-shells/bash:     3.2_p33
dev-lang/python:     2.5.2-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="berkdb cracklib crypt hardened imap midi mysql nls nptl nptlonly pam perl pic readline sasl ssl tcpd 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_dbd authn_default authz_default authz_host authz_user dav dav_fs dav_lock dbd dir env filter headers include info log_config mime mime_magic negotiation rewrite setenvif status substitute unique_id vhost_alias" APACHE2_MPMS="prefork" ELIBC="glibc" INPUT_DEVICES="mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 3 Anthony Sowden 2008-10-07 12:49:12 UTC
emerge --info (non hardened machine):

Portage 2.1.4.4 (default-linux/x86/2007.0/server, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r7 i686)
=================================================================
System uname: 2.6.25-gentoo-r7 i686 Pentium III (Coppermine)
Timestamp of tree: Tue, 07 Oct 2008 03:47:01 +0000
app-shells/bash:     3.2_p33
dev-lang/python:     2.5.2-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.virginmedia.com http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ ftp://ftp.mirrorservice.org/sites/www.ibiblio.org/gentoo/ "
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="apache2 aspell berkdb cdr cli cracklib crypt dri fortran gd gdbm gif gpm iconv innodb isdnlog javascript jpeg libwww mailwrapper midi mmx mudflap mysql mysqli ncurses nls nptl nptlonly openmp pam pcre pear perl php png pppd python readline reflection session spl ssl tcpd truetype unicode usb x86 xml xml2 xorg zlib" ALSA_CARDS="cs46xx" 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 asis auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta charset_lite dav dav_fs dav_lock dbd deflate dir disk_cache dumpio env expires ext_filter file_cache filter headers ident imagemap include info log_config log_forensic logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http rewrite setenvif speling status unique_id userdir usertrack version vhost_alias" APACHE2_MPMS="prefork" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev vesa mga vga"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 4 Anthony Sowden 2008-10-07 15:55:35 UTC
On the non-hardened machine, I have re-emerged apr, apr-util, mysql, apache and
php with FEATURES="nostrip".  I'm not sure if the apache backtrace is any more
helpful, but here it is:

gdb /usr/sbin/apache2
(gdb) run -D PHP5 -D SSL -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -t
Syntax OK
Program received signal SIGSEGV, Segmentation fault.
0xb6fe48f0 in ?? ()
(gdb) bt
#0  0xb6fe48f0 in ?? ()
#1  0xb6e90384 in thread_end () from /usr/lib/apr-util-1/apr_dbd_mysql-1.so
#2  0xb6e90376 in thread_end () from /usr/lib/apr-util-1/apr_dbd_mysql-1.so
#3  0xb7df802d in run_cleanups () from /usr/lib/libapr-1.so.0
#4  0x00000000 in ?? ()
Comment 5 Benedikt Böhm (RETIRED) gentoo-dev 2008-10-25 13:59:39 UTC
please run apache with -X if you're debugging with gdb, to force apache to the foreground with only one process running
Comment 6 Anthony Sowden 2008-10-27 14:03:36 UTC
Running with -X produces different results on the two systems.

On the hardened system apache still seg faults.  I do not have gdb available on this system.  My first inclination was to side step the -t part of the apache startup, and then to run in a single process, but neither of these made any difference.  This system is now running with downgraded apr and apr-util libraries, which was the only way I could get apache to start,

On the normal system, apache -X runs without seg faulting, although very slowly.  I have run apache in this way directly from the command line, and indirectly through gdb.  Apart from the very slow behaviour, everything appears to work as it should.

Running with both -X and -t (I don't think you meant this, but I'm not familiar with the way that apache is structured) produces the same seg faults and back traces that I've already provided.

I am able to recompile parts of the normal system quite easily.  The hardened system is not so easy to alter.
Comment 7 Timothy Benjamin Martin 2008-12-15 20:33:55 UTC
I'm seeing this on my install as well. The same fix (downgrading apr) worked for me. If there's any additional information that would be helpful from another source I'd be happy to contribute.
Comment 8 Timothy Benjamin Martin 2009-02-22 21:20:51 UTC
I did some leg work on this one recently. Looks like the problem is that apr{,-util} 1.3.x with mysql support links with libmysqlclient_r.so where as by default php with mysql support links with libmysql.so. These two libraries use the same symbols and same symbol versions which can cause any number of strange behaviors since they aren't really the same library.

Discussion about these issues here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=450535
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=469081
http://bugs.mysql.com/bug.php?id=32196

Debian has fixed this for their own distro, patch for php here:
http://svn.debian.org/wsvn/pkg-php/php5/trunk/debian/patches/force_libmysqlclient_r.patch?op=file&rev=0&sc=0

If you emerge php with the USE flag "threads" then it will automatically use the "_r" library (which i think stands for re-entrant) and this appears to be a usable workaround. I don't know what other changes that may make in php or what problems might come up when using single-threaded apache but having thread support in php.

Stefan Fritsch, on the apr dev list, said, "Also, I would expect that people who compile apache(prefork) with the embedded apr-util also don't have problems because they get a non-threaded apr-util that links to libmysqlclient.so." But I didn't try that solution... not even sure if you can with the portage ebuild.
Comment 9 nuitari 2009-03-08 09:03:47 UTC
I've been hit by that bug too, and Debian's patch worked perfectly for me on the servers who wouldn't start anymore.

Here are the version that I had:
apr-util 1.3.4
apache 2.2.11
php 5.2.8-r2
mysql 5.0.72-r1

I have a few server that are less up to date that have a segfault on stop and on -t, but working otherwise:
apr-util 1.3.2
apache 2.2.9
php 5.2.6-r5
mysql 5.0.60-r1
Comment 10 Anthony Sowden 2009-03-19 13:31:24 UTC
The Debian patch referenced in comment #8 works for me too.

I'm now running the following with both "-D PHP", and "DBDriver mysql":

www-servers/apache-2.2.10
dev-libs/apr-1.3.3
dev-libs/apr-util-1.3.4
dev-lang/php-5.2.8-r2
dev-db/mysql-5.0.70-r1

Without the Debian patch, this combination seg faults as described in the original post.  Thanks for the information Timothy.
Comment 11 nuitari 2009-03-30 06:12:34 UTC
Just updated 5 more servers with that debian patch and they all work fine.

Is there any chance of seeing it make its way to portage?
Comment 12 nuitari 2009-05-21 06:49:17 UTC
Is there any chance of seeing the patch in portage?
Comment 13 Christian Hoffmann (RETIRED) gentoo-dev 2009-05-21 07:57:09 UTC
I'm not really sure why we should force it.. USE=threads is already there and serves this purpose, imo.
So if this works without problems, I would not consider this a workaround but a solution. Then, we should try to express this as a USE dep so users don't have to care about it themselves.
Comments?
Comment 14 nuitari 2009-05-21 08:07:26 UTC
USE threads with PHP and mpm_prefork (the default worker) in Apache is a sure recipe for segfaults. It also is incompatible with sharedmem.

Comment 15 Corey Shaw 2009-06-15 15:28:05 UTC
Any word on getting this fix added to portage?  I'm experiencing the same problem and have downgraded to apr-util < 1.3 for now.
Comment 16 damage 2009-09-09 12:26:08 UTC
I have the same problem, the USE="threads" workaround does NOT work:

libphp5.so and apr_dbd_mysql.so are both using "libmysqlclient_r.so.15"


Versions:

www-servers/apache-2.2.11-r2
dev-lang/php-5.2.10
dev-db/mysql-5.0.70-r1


emerge --info:

Portage 2.1.6.13 (default/linux/amd64/2008.0, gcc-4.3.2, glibc-2.9_p20081201-r2, 2.6.26-gentoo-r4 x86_64)
=================================================================
System uname: Linux-2.6.26-gentoo-r4-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4800+-with-gentoo-1.12.11.1
Timestamp of tree: Wed, 09 Sep 2009 00:00:21 +0000
app-shells/bash:     3.2_p39
dev-lang/python:     2.5.4-r3, 2.6.2-r1
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.5, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -msse3 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/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 /etc/udev/rules.d"
CXXFLAGS="-march=athlon64 -msse3 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.manitu.net/gentoo"
LANG="de_DE.UTF-8"
LC_ALL="de_DE.UTF-8"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://mirror.manitu.net/gentoo-portage"
USE="3dnow 3dnowext acl amd64 apache2 bash-completion bzip2 clamav cli cracklib crypt ctype daemon dri enscript exif fam fortran ftp gd gdbm geoip gif gpm hddtemp iconv imagemagick inifile ipv6 isdnlog jpeg lm_sensors logrotate math mmx mmxext mpm-worker mudflap multilib mysql mysqli ncurses network-cron nls nptl nptlonly openmp pam pcre perl php png pppd python readline reflection session slang snmp soap sockets spl sqlite sse sse2 ssl suexec sysfs syslog tcpd threads tidy truetype unicode vhosts vim-syntax virtual-users xml xmlreader xmlwriter xorg zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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 auth_digest authn_dbd authn_default authn_file authz_default authz_host autoindex dav dav_fs dav_lock deflate dir expires headers include info log_config logio mime mime_magic negotiation proxy proxy_connect proxy_http rewrite setenvif so speling status vhost_alias authz_dbm authz_groupfile authz_owner authz_user filter unique_id dbd" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 17 Benedikt Böhm (RETIRED) gentoo-dev 2009-09-17 06:55:26 UTC
*** Bug 249596 has been marked as a duplicate of this bug. ***
Comment 18 Philip Taffner 2009-10-25 20:20:47 UTC
Created attachment 208249 [details, diff]
patch for php 5.2.11

Updated patch for php 5.2.11
Comment 19 Matti Bickel (RETIRED) gentoo-dev 2010-06-13 22:30:04 UTC
I'm wondering if this still happens?

Here's what I have:
[ebuild   R   ] dev-lang/php-5.3.2  USE="apache2 bzip2 calendar cgi cli crypt ctype curl doc exif filter gd hash iconv imap inifile ipv6 json mysql mysqli mysqlnd nls pdo pic posix postgres readline session simplexml spell ssl suhosin tokenizer truetype unicode xml xmlreader xsl zip zlib (-adabas) -bcmath -berkdb* (-birdstep) -cdb -cjk -concurrentmodphp -curlwrappers -db2 (-dbmaker) -debug -embed (-empress) (-empress-bcs) -enchant (-esoob) -fileinfo (-firebird) -flatfile (-frontbase) -ftp -gd-external -gdbm -gmp -interbase -intl -iodbc -kerberos -kolab -ldap -ldap-sasl -libedit -mbstring -mssql -oci8 -oci8-instant-client -odbc -pcntl -phar -qdbm -recode -sapdb -sharedext -sharedmem -snmp -soap -sockets (-solid) -sqlite -sqlite3 (-sybase-ct) -sysvipc -threads -tidy -wddx -xmlrpc -xmlwriter -xpm" 0 kB [1]

[ebuild   R   ] dev-libs/apr-util-1.3.9  USE="gdbm mysql -berkdb -doc -freetds -ldap -odbc -postgres -sqlite -sqlite3" 0 kB

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

terra profiles # /etc/init.d/apache2 restart
 * Starting apache2 ...
apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.178.29 for ServerName      [ ok ]

I have DBDriver mysql in my VirtualHost config.
No external patches applied. Can you reproduce the issue with a current setup?
Comment 20 Matti Bickel (RETIRED) gentoo-dev 2010-06-13 23:17:22 UTC
As was kindly pointed out to me by Dessa, USE="mysqlnd" hid the problem for me.
Seeing this "solves" the issue w/o the need to fiddle with USE="threads", I'll think about requiring php[mysqlnd] when apache was built with authn_dbd or dbd modules.
Comment 21 Matti Bickel (RETIRED) gentoo-dev 2010-07-09 19:30:28 UTC
Okay, quick update for this one:

dev-lang/php-5.3.2 was built with the following:
USE="apache2 bzip2 calendar cgi cli crypt ctype curl doc exif fileinfo filter gd hash iconv imap inifile ipv6 json (multilib) mysql mysqli nls pdo phar pic posix postgres readline session simplexml spell ssl suhosin tokenizer truetype unicode xml xmlreader xsl zip zlib (-adabas) -bcmath -berkdb (-birdstep) -cdb -cjk -concurrentmodphp -curlwrappers -db2 (-dbmaker) -debug -embed (-empress) (-empress-bcs) -enchant (-esoob) (-firebird) -flatfile (-frontbase) -ftp -gd-external -gdbm -gmp -interbase -intl -iodbc -kerberos -kolab -ldap -ldap-sasl -libedit -mssql -mysqlnd -oci8 -oci8-instant-client -odbc -pcntl -qdbm -recode -sapdb -sharedext -sharedmem -snmp -soap -sockets (-solid) -sqlite -sqlite3 (-sybase-ct) -sysvipc -threads -tidy -wddx -xmlrpc -xmlwriter -xpm" 

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

dev-libs/apr-util-1.3.9 was built with the following:
USE="gdbm (multilib) mysql -berkdb -doc -freetds -ldap -odbc -postgres -sqlite -sqlite3" 

terra vhosts.d # grep DBD /etc/apache2/vhosts.d/default_vhost.include
DBDriver mysql

terra vhosts.d # apache2ctl configtest
 * Checking apache2 configuration... [ ok ]
terra vhosts.d # 

Is the error gone or am I missing yet another bit?
Comment 22 Matti Bickel (RETIRED) gentoo-dev 2010-07-18 13:03:40 UTC
Please comment or reopen the bug if the issue persists.