#48821 [Opn->Fbk]: mysql_fetch_array segfaults on second parameter
| From: | jani@php.net | Date: | Tue, 21 Jul 2009 22:08:53 +0000 |
| Subject: | #48821 [Opn->Fbk]: mysql_fetch_array segfaults on second parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-140037@lists.php.net to get a copy of this message | ||
ID: 48821
Updated by: jani@php.net
Reported By: margus at zone dot ee
-Status: Open
+Status: Feedback
Bug Type: MySQL related
Operating System: CentOS 4.7/x86_64
PHP Version: 5.3.0
New Comment:
Neither of the provided configure lines produce CLI binary, so how can
it crash?
Previous Comments:
------------------------------------------------------------------------
[2009-07-16 08:18:24] margus at zone dot ee
Configure line for SAPI:
'./configure' '--prefix=/opt/zone'
'--with-config-file-path=/etc/opt/zone/php53-module'
'--with-apxs2=/opt/zone/sbin/apxs'
'--with-mysql=/opt/zone/x86_64/configure-for-mysql51'
'--with-pdo-mysql=/opt/zone/x86_64/configure-for-mysql51'
'--with-pdo-sqlite' '--disable-cli' '--with-openssl=/usr/x86_64'
'--enable-mbstring' '--with-curl=/usr/x86_64' '--with-gd'
'--enable-exif' '--with-zlib-dir=/usr/x86_64'
'--with-png-dir=/usr/x86_64' '--with-jpeg-dir=/usr/x86_64'
'--with-freetype-dir=/usr/x86_64' '--disable-sockets'
'--with-iconv=/opt/zone/x86_64' '--without-pear'
'--with-libxml-dir=/opt/zone/x86_64' '--disable-phar'
------------------------------------------------------------------------
[2009-07-06 18:41:25] margus at zone dot ee
Configure line is quite traditional:
'./configure' '--prefix=/opt/zone'
'--with-config-file-path=/etc/opt/zone/php53-module'
'--with-apxs2=/opt/zone/sbin/apxs'
'--with-mysql=/opt/zone/x86_64/configure-for-mysql51'
'--with-pdo-mysql=/opt/zone/x86_64/configure-for-mysql51'
'--with-pdo-sqlite' '--disable-cli' '--with-openssl=/usr/x86_64'
'--enable-mbstring' '--with-curl=/usr/x86_64' '--with-gd'
'--enable-exif' '--with-zlib-dir=/usr/x86_64'
'--with-png-dir=/usr/x86_64' '--with-jpeg-dir=/usr/x86_64'
'--with-freetype-dir=/usr/x86_64' '--disable-sockets'
'--with-iconv=/opt/zone/x86_64' '--without-pear'
'--with-libxml-dir=/opt/zone/x86_64' '--disable-phar'
------------------------------------------------------------------------
[2009-07-06 17:19:00] jani@php.net
What was the full configure line used to compile PHP?
------------------------------------------------------------------------
[2009-07-06 16:59:02] margus at zone dot ee
Description:
------------
mysql_fetch_assoc/mysql_fetch_array will segfault PHP if second
parameter (MYSQL_BOTH, MYSQL_ASSOC or MYSQL_NUM) is specified.
The value of parameter does'nt make any difference.
This happens only for PHP-CGI and Apache module and strangely not to
CLI.
Reproduce code:
---------------
<?php
mysql_connect ("localhost", "user", "password");
mysql_select_db ("test");
$r = mysql_query ("SELECT * FROM users");
print_r (mysql_fetch_assoc ($r, MYSQL_BOTH));
?>
Expected result:
----------------
Array
(
[id] => 1
[username] => asd1
[email] => asd2
[asd] => 2000
)
Actual result:
--------------
Segmentation fault
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48821&edit=1