Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 209606 - =php-5.2.5_p20080206: reproducible segfault on x86 w/ mysql_connect()
Summary: =php-5.2.5_p20080206: reproducible segfault on x86 w/ mysql_connect()
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL: http://bugs.php.net/bug.php?id=44094
Whiteboard:
Keywords:
: 209649 (view as bug list)
Depends on:
Blocks: 209148
  Show dependency tree
 
Reported: 2008-02-10 22:02 UTC by Christian Hoffmann (RETIRED)
Modified: 2008-02-12 16:50 UTC (History)
6 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 Christian Hoffmann (RETIRED) gentoo-dev 2008-02-10 22:02:46 UTC
=dev-lang/php-5.2.5_p20080206 makes cacti's poller.php crash while =dev-lang/php-5.2.5(-r1) worked fine. Vanilla is broken as well => see $URL.
Wating for upstream fix/comments...

Might be related to bug 209501 (which seems to be sparc-related, while this bug has been reproduced on x86 only until now).
Comment 1 Urs Joss 2008-02-11 08:56:16 UTC
Same here
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2008-02-11 13:02:25 UTC
*** Bug 209649 has been marked as a duplicate of this bug. ***
Comment 3 Christian Hoffmann (RETIRED) gentoo-dev 2008-02-11 14:33:05 UTC
Is anyone of you able to trigger that bug easily (i.e. a script of 10 lines or so)?
Is anyone having this problem with an application which does *not* use MySQL?

Could you please try
  php -r 'echo mysql_connect('localhost', 'root', 'password', true, 128);'
and see if it segfaults?

If it wasn't broken on vanilla as well I'd say I have messed up our mysql charset stuff, but apparently it's really reproducible on vanilla. I'm trying the same thing in a x86 chroot now (as I've not been able to reproduce it on amd64).

Thanks to tokyoahead in #gentoo-php who really helped by providing that example line and doing some additional debugging. =)
Comment 4 Hans Rakers 2008-02-11 14:48:29 UTC
Try that with Zend Optimizer 3.3.0a installed and it will insta-crash as i reported in http://bugs.gentoo.org/show_bug.cgi?id=209649#c1
Comment 5 Urs Joss 2008-02-11 14:50:20 UTC
(In reply to comment #3)
> Could you please try
>   php -r 'echo mysql_connect('localhost', 'root', 'password', true, 128);'
> and see if it segfaults?

Christian, I can confirm that this line (of course with the adjusted PW) fails as wel on my box.

HTH, regards, 
Urs
Comment 6 Guy Martin (RETIRED) gentoo-dev 2008-02-11 16:17:06 UTC
It crash as well with 20080210 vanilla snapshot. Updated bug title and upstream bug.
Comment 7 Christian Hoffmann (RETIRED) gentoo-dev 2008-02-11 23:21:45 UTC
Updated the upstream bug with some new results.
$AFFECTED_USERS, do you have USE=pic? I'm suspecting it's that causing the breakage.
Posting emerge -pv php and the arch (x86?) would not hurt.
Comment 8 Urs Joss 2008-02-12 06:46:54 UTC
Shortened output of eix -e php
[D] dev-lang/php
     Available versions:
        (4)     [M]4.4.8_pre20070816 [M]~4.4.8
        (5)     5.2.4_pre200708051230-r2 5.2.5-r1 [M]5.2.5_p20080206
     Installed versions:  5.2.5_p20080206(5)(07:58:34 2008-02-08)(apache2 bzip2 cgi cli ctype doc exif fastbuild ftp gd-external iconv mysql nls pcre pic posix readline session simplexml soap spell spl ssl tokenizer truetype unicode xml xsl zip zlib [...])

=> Yes, pic is set. I'll try to recompile w/o pic and post the results later
Comment 9 Urs Joss 2008-02-12 07:04:42 UTC
Ok, I can confirm that php-5.2.5_p20080206 compiled w/o pic on x86 does not result in a segfault when running
php -r 'echo mysql_connect('localhost', 'root', 'password', true, 128);'
Comment 10 Jakub Moc (RETIRED) gentoo-dev 2008-02-12 11:04:15 UTC
Please, test this patch if you are can reproduce the issue...

http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.213.2.6.2.20&r2=1.213.2.6.2.21&diff_format=u
Comment 11 Guy Martin (RETIRED) gentoo-dev 2008-02-12 11:59:20 UTC
Works for me.
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2008-02-12 12:08:16 UTC
Here's an ebuild for easier testing...

http://overlays.gentoo.org/svn/proj/php/testing/dev-lang/php/
Comment 13 Urs Joss 2008-02-12 12:22:15 UTC
Works for me as well. Thanks
Comment 14 Hans Rakers 2008-02-12 12:59:49 UTC
Works. Tested with the 5.2.5_p20080206-r2 ebuild from the php-testing overlay.

Also verified working with Zend Optimizer 3.3.0a and Suhosin 0.9.22.
Comment 15 Christian Hoffmann (RETIRED) gentoo-dev 2008-02-12 16:47:44 UTC
Thank you!
php-5.2.5_p20080206-r2, including the fix, is in CVS now (ebuild-wise it's not the same as in the overlay as it has some src_test optimizations, but the installed result is the same).