php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67565 mysqlnd_ms Crashes on var_dump
Submitted: 2014-07-04 04:50 UTC Modified: 2017-10-24 04:25 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: accounts at dotmanila dot com Assigned:
Status: Suspended Package: mysqlnd_ms (PECL)
PHP Version: 5.4.30 OS: CentOS 6.5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: accounts at dotmanila dot com
New email:
PHP Version: OS:

 

 [2014-07-04 04:50 UTC] accounts at dotmanila dot com
Description:
------------
When an unconnected mysqli object is var_dump'ed, mysqlnd_ms crashes.

Test script:
---------------
[revin@forge phpugph201407]$ cat master-slave.ini
mysqlnd_ms.enable=1
mysqlnd_ms.force_config_usage = 1
mysqlnd_ms.config_file=/home/revin/git/phpugph201407/mysqlnd_ms_ms.ini
[revin@forge phpugph201407]$ cat mysqlnd_ms_ms.ini
{
  "primary": {
    "master": {
      "master_1": {
        "host": "127.0.0.1",
        "port": "33001"
      }
    },
    "slave": {
    }
  },
  "standby": {
    "master": {
      "master_1": {
        "host": "127.0.0.1",
        "port": "33002"
      }
    },
    "slave": {
    }
  }
}
[revin@forge phpugph201407]$ php -c master-slave.ini -r '$c = mysqli_init(); var_dump($c);'

Warning: var_dump(): Property access is not allowed yet in Command line code on line 1

Warning: var_dump(): Property access is not allowed yet in Command line code on line 1

Warning: var_dump(): Property access is not allowed yet in Command line code on line 1

Warning: var_dump(): Property access is not allowed yet in Command line code on line 1

Warning: var_dump(): Property access is not allowed yet in Command line code on line 1

Warning: var_dump(): Property access is not allowed yet in Command line code on line 1

Warning: var_dump(): Property access is not allowed yet in Command line code on line 1

Warning: var_dump(): Property access is not allowed yet in Command line code on line 1
Segmentation fault

Actual result:
--------------
[revin@forge phpugph201407]$ gdb -ex 'set pagination=0' -batch -quiet -ex 'run -c master-slave.ini -r "\$c = mysqli_init(); var_dump(\$c);"' -ex 'bt full' php|grep 0x000
"on" or "off" expected.
#1  0x00007ffff0c48d6c in mysqlnd_ms_pick_first_master_or_slave (conn=<value optimized out>) at /var/tmp/mysqlnd_ms/mysqlnd_ms_switch.c:547
#2  0x00007ffff0c44947 in php_mysqlnd_ms_get_server_statistics_pub (proxy_conn=0xdb96d0, message=0x7fffffffc710, message_len=0x7fffffffc71c) at /var/tmp/mysqlnd_ms/mysqlnd_ms.c:2075
#3  0x00007ffff0822452 in link_stat_read (obj=0x7ffff7fd4f80, retval=0x7fffffffc768) at /usr/src/debug/php-5.4.30/ext/mysqli/mysqli_prop.c:275
#4  0x00007ffff081c883 in mysqli_read_property (object=0x7ffff7fd37f8, member=0x7fffffffc7d0, type=3, key=0x0) at /usr/src/debug/php-5.4.30/ext/mysqli/mysqli.c:344
#5  0x00007ffff081cb35 in mysqli_object_get_debug_info (object=0x7ffff7fd37f8, is_temp=0x7fffffffc848) at /usr/src/debug/php-5.4.30/ext/mysqli/mysqli.c:473
#6  0x000000000055eb3b in php_var_dump (struc=0x7ffff7f9f158, level=1) at /usr/src/debug/php-5.4.30/ext/standard/var.c:129
#7  0x000000000055ed59 in zif_var_dump (ht=<value optimized out>, return_value=<value optimized out>, return_value_ptr=<value optimized out>, this_ptr=<value optimized out>, return_value_used=<value optimized out>) at /usr/src/debug/php-5.4.30/ext/standard/var.c:183
#8  0x000000000065ee2c in zend_do_fcall_common_helper_SPEC (execute_data=<value optimized out>) at /usr/src/debug/php-5.4.30/Zend/zend_vm_execute.h:643
#9  0x000000000064c768 in execute (op_array=0x7ffff7fd3c68) at /usr/src/debug/php-5.4.30/Zend/zend_vm_execute.h:410
#10 0x00000000005d553e in zend_eval_stringl (str=<value optimized out>, str_len=<value optimized out>, retval_ptr=0x0, string_name=0x6fad69 "Command line code") at /usr/src/debug/php-5.4.30/Zend/zend_execute_API.c:1205
#11 0x00000000005d5619 in zend_eval_stringl_ex (str=<value optimized out>, str_len=<value optimized out>, retval_ptr=<value optimized out>, string_name=<value optimized out>, handle_exceptions=1) at /usr/src/debug/php-5.4.30/Zend/zend_execute_API.c:1252
#12 0x000000000068de84 in do_cli (argc=5, argv=0x7fffffffe128) at /usr/src/debug/php-5.4.30/sapi/cli/php_cli.c:1029
#13 0x000000000068e8a8 in main (argc=5, argv=0x7fffffffe128) at /usr/src/debug/php-5.4.30/sapi/cli/php_cli.c:1365

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-24 04:25 UTC] kalle@php.net
-Status: Open +Status: Suspended
 [2017-10-24 04:25 UTC] kalle@php.net
I'm gonna suspend this report as the mysqlnd_ms had not a release since 2013 or active commit activity since then, if activity comes back to this package, it should be re-opened
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu May 08 20:01:32 2025 UTC