Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 276583 - Stabilize dev-php5/suhosin-0.9.29 to fix crashes with >=php-5.2.10
Summary: Stabilize dev-php5/suhosin-0.9.29 to fix crashes with >=php-5.2.10
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL: http://www.dotdeb.org/2009/06/25/php-...
Whiteboard:
Keywords:
Depends on:
Blocks: CVE-2009-3291
  Show dependency tree
 
Reported: 2009-07-05 13:48 UTC by Hanno Böck
Modified: 2009-11-06 10:16 UTC (History)
7 users (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 Hanno Böck gentoo-dev 2009-07-05 13:48:51 UTC
I encountered segfaults with php 5.2.10 installations on various servers. After googling around, I found this blog-entry:
http://www.dotdeb.org/2009/06/25/php-5-2-10-packages-for-lennyetch-are-now-available/

It's about debian, but the issue seems to be the same and appears in combination with suhosin. disabling suhosin session encryption workarounds the issue.
Comment 1 Christian Hoffmann (RETIRED) gentoo-dev 2009-07-05 23:27:29 UTC
Hmm, hadn't heard about that. First thought was that we are not using the 5.2.10 version of the suhosin patch, but the previous one. But apparently the problem is caused by the extension and not by the patch.
The linked post suggests suhosin.session.encrypt = Off as a workaround.

Please retry with php-5.2.10-r1, which has the new suhosin patch. If it doesn't help, please reopen and we'll have to wait for news from suhosin upstream.
Comment 2 Hanno Böck gentoo-dev 2009-07-06 08:32:05 UTC
Still happens with -r1:

Jul  6 10:30:06 milch grsec: From 82.113.121.149: signal 11 sent to /usr/lib64/php5/bin/php-cgi[php-cgi:20827] uid/euid:1002/1002 gid/egid:100/100, parent /usr/lib64/php5/bin/php-cgi[php-cgi:20826] uid/euid:1002/1002 gid/egid:100/100
Jul  6 10:30:56 milch php-cgi[20830]: segfault at 12a2ce4 ip 00000000006e63d2 sp 00007fff34d042d0 error 4 in php-cgi[400000+6bf000]
Jul  6 10:30:56 milch grsec: From 82.113.121.149: signal 11 sent to /usr/lib64/php5/bin/php-cgi[php-cgi:20830] uid/euid:1002/1002 gid/egid:100/100, parent /usr/lib64/php5/bin/php-cgi[php-cgi:20826] uid/euid:1002/1002 gid/egid:100/100
Comment 3 Joaquim Uchoa 2009-07-06 22:08:28 UTC
Same problem here, I need to downgrade to version 5.2.9 to get webserver working without problems again... 

This was from my error_log:
[Thu Jul 02 07:22:37 2009] [notice] child pid 31597 exit signal Segmentation fault (11)
[Thu Jul 02 07:58:34 2009] [notice] child pid 1393 exit signal Segmentation fault (11)
[Thu Jul 02 08:01:48 2009] [notice] child pid 1395 exit signal Segmentation fault (11)
[Thu Jul 02 08:04:44 2009] [notice] child pid 8777 exit signal Segmentation fault (11)
[Thu Jul 02 08:05:21 2009] [notice] child pid 8422 exit signal Segmentation fault (11)
[Thu Jul 02 08:11:06 2009] [notice] child pid 9461 exit signal Segmentation fault (11)
[Thu Jul 02 08:12:02 2009] [notice] child pid 9281 exit signal Segmentation fault (11)

Comment 4 Gerard 2009-07-07 10:30:44 UTC
encountering the same problem, first thought that it was related to mod_fcgid, so installed mod_fastcgi. But this resolved nothing. 

The errors: 
[Tue Jul 07 12:14:57 2009] [warn] FastCGI: (dynamic) server "/var/www/fcgi-bin.d/php5-default_vhost/php-fcgi-wrapper" (pid 24837) terminated due to uncaught signal '11' (Segmentation fault)

[Tue Jul 07 12:22:00 2009] [notice] mod_fcgid: process /var/www/fcgi-bin.d/php5-default_vhost/php-fcgi-wrapper(26220) exit(communication error), get unexpected signal 11

Downgrading to php-5.2.9-r2 does resolve the issue. 

My php use flags: 
[ebuild   R   ] dev-lang/php-5.2.10  USE="bcmath berkdb bzip2 calendar cgi crypt curl curlwrappers exif filter force-cgi-redirect ftp gd hash iconv imap inifile mysql mysqli nls pcre pic posix readline session simplexml snmp soap sockets spl ssl suhosin threads tokenizer truetype unicode xml xmlreader xmlrpc xmlwriter zip zlib -adabas -apache2 -birdstep -cdb -cjk -cli -concurrentmodphp -ctype -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -fastbuild -fdftk -firebird -flatfile -frontbase -gd-external -gdbm -gmp -interbase -iodbc -ipv6 (-java-external) -json -kerberos -kolab -ldap -ldap-sasl -libedit -mcve -mhash -msql -mssql -ncurses -oci8 (-oci8-instant-client) -odbc -pcntl -pdo -postgres -qdbm -recode -reflection -sapdb -sharedext -sharedmem -solid -spell -sqlite -sybase -sybase-ct -sysvipc -tidy -wddx -xpm -xsl -yaz" 0 kB
Comment 5 Florian Knodt 2009-07-08 14:12:27 UTC
Same here with dev-lang/php-5.2.10 and dev-lang/php-5.2.10-r1 in combination with dev-php5/suhosin-0.9.27, www-apache/mod_fcgid-2.2 and www-servers/apache-2.2.11-r1.

I get messages like those in #4, with dev-php5/eaccelerator its more detailed:

[notice] mod_fcgid: process *** exit(communication error), get unexpected signal 11
EACCELERATOR: PHP crashed on opline 527 of session_start() at ***:***

Both suggestions (downgrade to dev-lang/php-5.2.9-r2 or suhosin.session.encrypt = Off) seem to work.

Also note that according to the link posted in the original report this should only affect (f)CGI-based systems.
Comment 6 Christian Hoffmann (RETIRED) gentoo-dev 2009-07-09 20:20:23 UTC
Just curious, did you try rebuilding the extensions in question? (suhosin and/or eA)? If not, please do so.
I'm not able to reproduce it atm and I haven't found anything new on the web (esp. on the debian bug).
I quickly asked upstream, the tenor was "ea and suhosin poke the innards in a way that we cannot guarantee will not break at any time", so I guess we cannot expect a "fix" or workaround from upstream, unless we prove it is a php bug :(
Let's hope for some news from the maintainers of the affected extensions, also, I might provide a php-5.2.10-r2 in a few days (once the php cvs -> svn conversion has completed) which reverts the huge ext/session change from 5.2.10.
Comment 7 Christian Hoffmann (RETIRED) gentoo-dev 2009-07-09 21:15:13 UTC
Please try php-5.2.10-r2 from the php-testing overlay. It contains a patch which reverts ext/session to the state of php-5.2.9.
This should just be used to track down the bug and to provide an intermediate solution (it's better using this version than reverting to 5.2.9 in completely).

Hope this helps, please report back.

As this is only a (possible) workaround and no solution, I'm leaving the bug open.
Comment 8 Hanno Böck gentoo-dev 2009-07-10 10:47:02 UTC
I had rebuilded all extensions, this didn't change anything. I've just tried with your -r2-ebuild, same issue (also with rebuilding extensions).

Have you contacted Stefan Esser about the issue yet?
Comment 9 Gerard 2009-07-10 11:39:24 UTC
I can't try php-5.2.10-r2, the server is already in production, but with php-5.2.9. But the error appeared on a clean installed (hardened) machine. Not after updating for years. 
Comment 10 Maurizio Firmani 2009-07-23 07:13:41 UTC
I have 'segmentation fault' with php 5.2.10 using imap. I have no suhosin ext enabled.
This is my use flag for php

[ebuild   R   ] dev-lang/php-5.2.10  USE="apache2 berkdb bzip2 calendar cli crypt ctype curl dbase exif gd gdbm hash iconv imap json mysql mysqli ncurses nls pcre pdo readline reflection session simplexml soap sockets spell spl sqlite ssl tidy tokenizer truetype unicode xml xsl zlib (-adabas) -bcmath (-birdstep) -cdb -cgi -cjk -concurrentmodphp -curlwrappers -db2 (-dbmaker) -debug -discard-path -doc (-empress) (-empress-bcs) (-esoob) -fastbuild (-fdftk) -filter (-firebird) -flatfile -force-cgi-redirect (-frontbase) -ftp -gd-external -gmp -inifile -interbase -iodbc -ipv6 (-java-external) -kerberos -kolab -ldap -ldap-sasl -libedit -mcve -mhash -msql -mssql -oci8 -oci8-instant-client -odbc -pcntl -pic -posix -postgres -qdbm -recode -sapdb -sharedext -sharedmem -snmp (-solid) -suhosin (-sybase) (-sybase-ct) -sysvipc -threads -wddx -xmlreader -xmlrpc -xmlwriter -xpm -yaz -zip" 0 kB
Comment 11 Igor Novgorodov 2009-07-23 13:03:05 UTC
Same issue with apache 2.2.11-r2, it does not matter whether it's built with suhosin or not (it's the first thing that i've tried to disable).

USE Flags:
dev-lang/php sharedmem snmp soap cli crypt iconv pcre libedit session spl zlib apache2 bcmath bzip2 calendar ctype curl exif ftp gd gmp hardenedphp hash imap mhash mysqli mysql posix simplexml sockets sqlite tidy truetype xml xmlreader xmlrpc xmlwriter xsl tokenizer filter suhosin json ldap pdo

make.conf's optimization flags for GCC were disabled too to test if they're the issue, no effect:
[Thu Jul 23 16:22:48 2009] [notice] Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8k PHP/5.2.10-pl0-gentoo with Suhosin-Patch configured -- resuming normal operations
[Thu Jul 23 16:23:06 2009] [notice] child pid 4607 exit signal Segmentation fault (11)
[Thu Jul 23 16:23:15 2009] [notice] child pid 4609 exit signal Segmentation fault (11)
[Thu Jul 23 16:23:17 2009] [notice] child pid 4611 exit signal Segmentation fault (11)

The issue is easily reproduced with phpMyAdmin (just open random pages there, the segfaults will happen on a stable basis)
Comment 12 Rodrigo Saboya 2009-07-29 19:14:54 UTC
I was experiencing the same problem with phpMyAdmin, with suhosin enabled. I didn't try withouth suhosin, I simply downgraded to 5.2.9 and the segfaults went away.
Comment 13 Craig Andrews gentoo-dev 2009-07-30 14:32:21 UTC
I was able to create a stable (non-segfaulting) php 5.2.10 installation by disable the suhosin extension (I still have php's suhosin use flag enabled) and using -threads for php and apache (switching the apache MPM to prefork). Enabling either the suhosin extension or using the worker MPM causes PHP to segfault, or throw random, nonsense errors (such as syntax errors where there are none).

www-servers/apache-2.2.11-r3
dev-lang/php-5.2.10-r1
Comment 14 Marcel Partap 2009-08-06 11:46:06 UTC
You might be hitting an (incredibly stupid) APC bug, try putting suhosin.apc_bug_workaround = on
into the suhosin conf file.. if that don't work, try with
suhosin.session.encrypt = off
Comment 15 Markus Ullmann (RETIRED) gentoo-dev 2009-09-07 19:02:11 UTC
I hit the same bug, yet there are rumours in the debian bugtracker that it is solved in 0.9.28
Comment 16 Hanno Böck gentoo-dev 2009-09-11 09:21:32 UTC
I've committed suhosin 0.9.29 to the tree. Though the machine I saw this error is a production one, so I don't want to try out, can others please see if this fixes this bug?
Comment 17 Christian Hoffmann (RETIRED) gentoo-dev 2009-10-05 20:37:03 UTC
As the most recent version apparently fixes these rather critical issues, which are happening with stable php, I guess we should stabilize this version.

Arches, please test and mark stable:
=dev-php5/suhosin-0.9.29
Target keywords : "alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86"
Comment 18 William Waisse 2009-10-06 18:00:00 UTC
 same here, php-5.2.10 , apache-2.2.11-r2 , suhosin-0.9.27

 appear very often with phpmyadmin

 I now try :
    php_flag suhosin.executor.disable_eval Off
    php_flag suhosin.apc_bug_workaround on
 before downgrading to php 5.2.9

 

Comment 19 Christian Faulhammer (RETIRED) gentoo-dev 2009-10-06 22:38:39 UTC
x86 stable
Comment 20 Jeroen Roovers (RETIRED) gentoo-dev 2009-10-06 23:43:01 UTC
Stable for HPPA.
Comment 21 Raúl Porcel (RETIRED) gentoo-dev 2009-10-07 16:01:18 UTC
alpha/arm/ia64/s390/sh/sparc stable
Comment 22 nixnut (RETIRED) gentoo-dev 2009-10-07 17:40:39 UTC
ppc stable
Comment 23 Christian Hoffmann (RETIRED) gentoo-dev 2009-10-09 14:03:21 UTC
amd64 stable, mainly to be able to add the php dependency on suhosin per bug 276583
Comment 24 Brent Baude (RETIRED) gentoo-dev 2009-10-18 14:20:11 UTC
ppc64 done
Comment 25 Tobias Heinlein (RETIRED) gentoo-dev 2009-11-06 10:13:56 UTC
amd64 stable as per comment #23, removing CC.
Comment 26 Tobias Heinlein (RETIRED) gentoo-dev 2009-11-06 10:16:33 UTC
All arches done. Will be mentioned in GLSA for PHP bugs.