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

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

 New Comment:

valgrind output would be helpful :)

Thanks!


Previous Comments:
------------------------------------------------------------------------
[2010-08-27 22:00:08] php at group dot apple dot com

This reproduces on Mac OS X, and appears to be a stack overflow issue. I
enabled 

stack overflow protection by adding "-g -fstack-protector-all" to the
CFLAGS passed 

to configure. (The problem does not reproduce when configured with
--enable-debug 

or -O0 instead of -Os.) In running this through gdb, the following line
in changes 

execute_data and may be the start of the corruption:

  zend_vm_execute.h:301                 EX_T(opline->result.u.var).var.ptr_ptr 
= 

&EX_T(opline->result.u.var).var.ptr;



With the following sample script, the third pass through 

zend_do_fcall_common_helper_SPEC() demonstrates the crash:



<?php



$db_host = 'localhost';

$db_user = 'mysql_dba';

$db_password = 'admin';

$db_port = '3306';



$db_conn = mysql_connect($db_host.':'.$db_port, $db_user,
$db_password);



$db_result = mysql_query('select version() as version;', $db_conn);



$row = mysql_fetch_array($db_result, MYSQL_ASSOC); // this does NOT
work

// $row = mysql_fetch_assoc($db_result); // this works



printf("mysql version: %s\n", $row['version']);



mysql_free_result($db_result);



mysql_close($db_conn);



?>

------------------------------------------------------------------------
[2010-08-26 13:27:05] u...@php.net

Please try to provide a short test script, like its good style with
every other bug report.

------------------------------------------------------------------------
[2010-08-25 10:32:16] paj...@php.net

Latest drupal (6+) versions work with 5.3 smoothly.

------------------------------------------------------------------------
[2010-08-25 10:22:29] mbecc...@php.net

@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?

------------------------------------------------------------------------
[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.

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


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

Reply via email to