Bug #51248 [Fbk->Opn]: Segmentation fault in mysql_fetch_array

From: Date: Wed, 25 Aug 2010 08:22:29 +0000
Subject: Bug #51248 [Fbk->Opn]: Segmentation fault in mysql_fetch_array
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-153777@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51248&edit=1

 ID:                 51248
 Updated by:         mbeccati@php.net
 Reported by:        mbeccati@php.net
 Summary:            Segmentation fault in mysql_fetch_array
-Status:             Feedback
+Status:             Open
 Type:               Bug
 Package:            MySQL related
 Operating System:   FreeBSD 6.2
 PHP Version:        5.3.2
 Assigned To:        mysql
 Block user comment: N

 New Comment:

@Chris: I understand that Drupal and PHP 5.3 might not live happily
together, but I'd expect errors, not segmentation faults.

@Andrey: Is there anything I can do to help understanding what happens
on when using libmysql?


Previous Comments:
------------------------------------------------------------------------
[2010-08-24 20:14:29] chris at chrischarlton dot us

Drupal 6.14 was the first 6.x to start supporting PHP 5.3, but mileage
will vary. 
It is highly recommended to run Drupal on a PHP 5.2.x server. Of course
Drupal will 
natively support PHP 5.3, there are just a few kinks being worked out.

------------------------------------------------------------------------
[2010-04-09 09:27:41] mbeccati@php.net

I've been able to test the drush script with a newly compiled 5.3.2 w/
mysqlnd and it appears that the segmentation fault is gone. Is there any
way I can trace what happens with libmysql?

i.e.

libmysql:
$ /usr/local/bin/php ~/bin/drush/drush.php dis twitter
The following projects will be disabled: twitter
Do you really want to continue? (y/n): y
Segmentation fault: 11 (core dumped)

mysqlnd:
$ /array1/compile/php-5.3.2-apache/sapi/cli/php -d
mysqlnd.debug="t:o,/tmp/mysqlnd.trace" ~/bin/drush/drush.php dis
twitter
The following projects will be disabled: twitter
Do you really want to continue? (y/n): y
twitter was disabled successfully.                                  
[ok]

------------------------------------------------------------------------
[2010-04-08 16:57:29] mbeccati@php.net

I've been using libmysql, but IIRC I've also tried mysqlnd and had the
same result. As soon as I have time, I'll try to make a test build with
mysqlnd and generate the trace file.

------------------------------------------------------------------------
[2010-04-08 16:50:54] andrey@php.net

Do you use libmysql or mysqlnd as the underlying library? if mysqlnd
then can you try a debug build and put into your php.ini :
mysqlnd.debug="t:o,/tmp/mysqlnd.trace" . Then please mail me the trace
file because it won't be small.
Thanks!

Andrey

------------------------------------------------------------------------
[2010-03-29 21:03:43] mgarrison at alienz dot net

I'm also able to reproduce this but with custom code, replicated with
5.3.2 and 
php5.3-201003291630 on a CentOS 4.8 box. Doesn't happen in php 5.2.12.

(gdb) bt
#0  0x00007fdcc37cdac3 in zend_fetch_resource (passed_id=0x7fffd484e6a0,

default_id=-1, resource_type_name=0x7fdcc3a8ce08 "MySQL result", 
found_resource_type=0x0, num_resource_types=1)
    at /usr/src/php-5.3.2/Zend/zend_list.c:127
#1  0x00007fdcc3651846 in php_mysql_fetch_hash (ht=2, 
return_value=0x7fdcbf0e2970, return_value_ptr=Variable
"return_value_ptr" is not 
available.
) at /usr/src/php-5.3.2/ext/mysql/php_mysql.c:1944
#2  0x00007fdcc3651dcb in zif_mysql_fetch_array (ht=-729487712, 
return_value=0xffffffff, return_value_ptr=0x7fdcc37cd9cf, this_ptr=0x0,

return_value_used=1)
    at /usr/src/php-5.3.2/ext/mysql/php_mysql.c:2105
#3  0x00007fdcc37e2c62 in zend_do_fcall_common_helper_SPEC 
(execute_data=0x7fdcc2b34310) at
/usr/src/php-5.3.2/Zend/zend_vm_execute.h:313
#4  0x00007fdcc37e2089 in execute (op_array=0x7fdcbf4841c8) at
/usr/src/php-
5.3.2/Zend/zend_vm_execute.h:104
#5  0x00007fdcc37c0345 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) at /usr/src/php-5.3.2/Zend/zend.c:1194
#6  0x00007fdcc376e67d in php_execute_script
(primary_file=0x7fffd4850da0) at 
/usr/src/php-5.3.2/main/main.c:2260
#7  0x00007fdcc3845d12 in apache_php_module_main (r=Variable "r" is not

available.
) at /usr/src/php-5.3.2/sapi/apache/sapi_apache.c:53
#8  0x00007fdcc38468ce in send_php (r=0xcec3d0, display_source_mode=0, 
filename=0x0) at /usr/src/php-5.3.2/sapi/apache/mod_php5.c:682
#9  0x00007fdcc3846ac3 in send_parsed_php (r=0x7fffd484e6a0) at
/usr/src/php-
5.3.2/sapi/apache/mod_php5.c:697
#10 0x00000000004428e4 in ap_invoke_handler ()
#11 0x000000000045a74e in process_request_internal ()
#12 0x000000000045ac19 in ap_internal_redirect ()
#13 0x00007fdcc3ee7f7c in mod_gzip_redir1_handler () from 
/var/www/libexec/mod_gzip.so
#14 0x00007fdcc3ee61eb in mod_gzip_handler () from
/var/www/libexec/mod_gzip.so
#15 0x00000000004428e4 in ap_invoke_handler ()
#16 0x000000000045a74e in process_request_internal ()
#17 0x000000000045a7a3 in ap_process_request ()
#18 0x0000000000450a06 in child_main ()
#19 0x0000000000450cf1 in make_child ()
#20 0x000000000045109e in perform_idle_server_maintenance ()
#21 0x00000000004516c3 in standalone_main ()
#22 0x0000000000451cb7 in main ()

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=51248


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51248&edit=1


Thread (28 messages)

« previous php.bugs (#153777) next »