Edit report at https://bugs.php.net/bug.php?id=60778&edit=1
ID: 60778
Comment by: vitex at hippy dot cz
Reported by: yoram dot b at zend dot com
Summary: mysqli object crashes when given to var_dump
Status: Assigned
Type: Bug
Package: MySQLi related
Operating System: Linux debian
PHP Version: 5.4.0RC5
Assigned To: andrey
Block user comment: N
Private report: N
New Comment:
Dear developers please fix it.
While debbuging with xdebug it produce hunderts of error messages
and is not easy to develop php code.
Thanks!
Previous Comments:
------------------------------------------------------------------------
[2012-01-17 14:03:45] yoram dot b at zend dot com
Description:
------------
This happens when mysqli uses libmysql (not mysqlnd). tested with php 5.40RC5
and PHP 5.3.3.
php -r '$a = new mysqli; var_dump($a);'
gives a lot or warnings "PHP Warning: var_dump(): Property access is not
allowed yet in Command line code on line 1"
and then crashes with segmentation fault.
same with apache module.
backtrace:
#0 0xb639f45b in mysql_stat () from /usr/lib/libmysqlclient.so.16
#1 0xb65fd80b in link_stat_read (obj=0xb7d44ca0, retval=0xbfffee80)
at
/home/yoram/ZendModules/patched-php-src-5.4.0RC5/php-5.4.0RC5/ext/mysqli/mysqli_prop.c:275
#2 0xb65ecb14 in mysqli_read_property (object=0xb7d43f10, member=0xbfffeeec,
type=3, key=0x0)
at
/home/yoram/ZendModules/patched-php-src-5.4.0RC5/php-5.4.0RC5/ext/mysqli/mysqli.c:341
#3 0xb65ed050 in mysqli_object_get_debug_info (object=0xb7d43f10,
is_temp=0xbfffefd0)
at
/home/yoram/ZendModules/patched-php-src-5.4.0RC5/php-5.4.0RC5/ext/mysqli/mysqli.c:470
#4 0x082fb926 in php_var_dump (struc=0xb7d2a0cc, level=1) at
/php-5.4.0RC5/ext/standard/var.c:129
#5 0x082fbd22 in zif_var_dump (ht=1, return_value=0xb7d43ef4,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=0)
at /php-5.4.0RC5/ext/standard/var.c:183
#6 0x083eba4d in zend_do_fcall_common_helper_SPEC (execute_data=0xb7d2a030) at
/php-5.4.0RC5/Zend/zend_vm_execute.h:642
#7 0x083f2163 in ZEND_DO_FCALL_SPEC_CONST_HANDLER (execute_data=0xb7d2a030) at
/php-5.4.0RC5/Zend/zend_vm_execute.h:2215
#8 0x083ea5b7 in execute (op_array=0xb7d44308) at
/php-5.4.0RC5/Zend/zend_vm_execute.h:410
#9 0x083a804c in zend_eval_stringl (str=0xbffffa06 "$a = new mysqli;
var_dump($a);", str_len=30, retval_ptr=0x0,
string_name=0x8755734 "Command line code") at
/php-5.4.0RC5/Zend/zend_execute_API.c:1199
#10 0x083a8256 in zend_eval_stringl_ex (str=0xbffffa06 "$a = new mysqli;
var_dump($a);", str_len=30, retval_ptr=0x0,
string_name=0x8755734 "Command line code", handle_exceptions=1) at
/php-5.4.0RC5/Zend/zend_execute_API.c:1242
#11 0x083a82ec in zend_eval_string_ex (str=0xbffffa06 "$a = new mysqli;
var_dump($a);", retval_ptr=0x0,
string_name=0x8755734 "Command line code", handle_exceptions=1) at
/php-5.4.0RC5/Zend/zend_execute_API.c:1253
#12 0x084c430a in do_cli (argc=3, argv=0xbffff834) at
/php-5.4.0RC5/sapi/cli/php_cli.c:1023
#13 0x084c50cc in main (argc=3, argv=0xbffff834) at
/php-5.4.0RC5/sapi/cli/php_cli.c:1356
(gdb) frame 2
#2 0xb65ecb14 in mysqli_read_property (object=0xb7d43f10, member=0xbfffeeec,
type=3, key=0x0)
at
/home/yoram/ZendModules/patched-php-src-5.4.0RC5/php-5.4.0RC5/ext/mysqli/mysqli.c:341
341 ret = hnd->read_func(obj, &retval TSRMLS_CC);
Test script:
---------------
$a = new mysqli; var_dump($a);
Actual result:
--------------
backtrace:
#0 0xb639f45b in mysql_stat () from /usr/lib/libmysqlclient.so.16
#1 0xb65fd80b in link_stat_read (obj=0xb7d44ca0, retval=0xbfffee80)
at
/home/yoram/ZendModules/patched-php-src-5.4.0RC5/php-5.4.0RC5/ext/mysqli/mysqli_prop.c:275
#2 0xb65ecb14 in mysqli_read_property (object=0xb7d43f10, member=0xbfffeeec,
type=3, key=0x0)
at
/home/yoram/ZendModules/patched-php-src-5.4.0RC5/php-5.4.0RC5/ext/mysqli/mysqli.c:341
#3 0xb65ed050 in mysqli_object_get_debug_info (object=0xb7d43f10,
is_temp=0xbfffefd0)
at
/home/yoram/ZendModules/patched-php-src-5.4.0RC5/php-5.4.0RC5/ext/mysqli/mysqli.c:470
#4 0x082fb926 in php_var_dump (struc=0xb7d2a0cc, level=1) at
/php-5.4.0RC5/ext/standard/var.c:129
#5 0x082fbd22 in zif_var_dump (ht=1, return_value=0xb7d43ef4,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=0)
at /php-5.4.0RC5/ext/standard/var.c:183
#6 0x083eba4d in zend_do_fcall_common_helper_SPEC (execute_data=0xb7d2a030) at
/php-5.4.0RC5/Zend/zend_vm_execute.h:642
#7 0x083f2163 in ZEND_DO_FCALL_SPEC_CONST_HANDLER (execute_data=0xb7d2a030) at
/php-5.4.0RC5/Zend/zend_vm_execute.h:2215
#8 0x083ea5b7 in execute (op_array=0xb7d44308) at
/php-5.4.0RC5/Zend/zend_vm_execute.h:410
#9 0x083a804c in zend_eval_stringl (str=0xbffffa06 "$a = new mysqli;
var_dump($a);", str_len=30, retval_ptr=0x0,
string_name=0x8755734 "Command line code") at
/php-5.4.0RC5/Zend/zend_execute_API.c:1199
#10 0x083a8256 in zend_eval_stringl_ex (str=0xbffffa06 "$a = new mysqli;
var_dump($a);", str_len=30, retval_ptr=0x0,
string_name=0x8755734 "Command line code", handle_exceptions=1) at
/php-5.4.0RC5/Zend/zend_execute_API.c:1242
#11 0x083a82ec in zend_eval_string_ex (str=0xbffffa06 "$a = new mysqli;
var_dump($a);", retval_ptr=0x0,
string_name=0x8755734 "Command line code", handle_exceptions=1) at
/php-5.4.0RC5/Zend/zend_execute_API.c:1253
#12 0x084c430a in do_cli (argc=3, argv=0xbffff834) at
/php-5.4.0RC5/sapi/cli/php_cli.c:1023
#13 0x084c50cc in main (argc=3, argv=0xbffff834) at
/php-5.4.0RC5/sapi/cli/php_cli.c:1356
(gdb) frame 2
#2 0xb65ecb14 in mysqli_read_property (object=0xb7d43f10, member=0xbfffeeec,
type=3, key=0x0)
at
/home/yoram/ZendModules/patched-php-src-5.4.0RC5/php-5.4.0RC5/ext/mysqli/mysqli.c:341
341 ret = hnd->read_func(obj, &retval TSRMLS_CC);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60778&edit=1