#46090 [NEW]: mysqlnd segfault during connection

From: Date: Tue, 16 Sep 2008 01:20:15 +0000
Subject: #46090 [NEW]: mysqlnd segfault during connection
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-129009@lists.php.net to get a copy of this message
From:             phpwnd at gmail dot com
Operating system: Linux 2.6.24-gentoo-r8
PHP version:      5.3CVS-2008-09-16 (CVS)
PHP Bug Type:     PDO related
Bug description:  mysqlnd segfault during connection

Description:
------------
mysqlnd makes PHP segfault on connect.

This bug is filed as "PDO", but it's really a mysqlnd bug. The issue is
the same regardless of what extension is used: PDO, MySQL or MySQLi. PHP
was compiled from CVS, with --with-mysql=mysqlnd --with-mysqli=mysqlnd
--with-pdo-mysql=mysqlnd

- Connecting via TCP or socket does not change the behaviour.
- It doesn't require a valid account either, attempting to connect with an
inexistent account produces the same result.
- It does require a valid DSN, otherwise a PDOException with message
'SQLSTATE[HY000] [2002] Connection refused' is thrown, as expected.

Backtrace below, if you need anything else please ask. Thanks :)

Reproduce code:
---------------
$db = new PDO('mysql:dbname=test;host=127.0.0.1;port=3307',
'inexistent_user', 'password');

Actual result:
--------------
#0  0x000000000075d729 in mysqlnd_connect (conn=0xece3c8, host=0xece288
"127.0.0.1", user=0xece160 "inexistent_user", passwd=0xece1c8
"password",
    passwd_len=8, db=0xece228 "test", db_len=4, port=3307, socket=0x0,
mysql_flags=196736, zval_cache=0xea0c50)
    at /root/src/php5/ext/mysqlnd/mysqlnd.c:823
#1  0x000000000058475a in pdo_mysql_handle_factory (dbh=0xecdbc0,
driver_options=0x0) at /root/src/php5/ext/pdo_mysql/mysql_driver.c:717
#2  0x00000000005739c7 in zim_PDO_dbh_constructor (ht=3,
return_value=0xece068, return_value_ptr=0x0, this_ptr=0xecc200,
return_value_used=0)
    at /root/src/php5/ext/pdo/pdo_dbh.c:372
#3  0x000000000083a574 in zend_do_fcall_common_helper_SPEC
(execute_data=0x2add638ad090) at /root/src/php5/Zend/zend_vm_execute.h:315
#4  0x000000000083b509 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0x2add638ad090) at /root/src/php5/Zend/zend_vm_execute.h:428
#5  0x00000000008395a7 in execute (op_array=0xeccfb0) at
/root/src/php5/Zend/zend_vm_execute.h:104
#6  0x000000000080981e in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /root/src/php5/Zend/zend.c:1197
#7  0x000000000078e21a in php_execute_script (primary_file=0x7fff472a8590)
at /root/src/php5/main/main.c:2075
#8  0x00000000008ad1d4 in main (argc=2, argv=0x7fff472a8808) at
/root/src/php5/sapi/cli/php_cli.c:1130

-- 
Edit bug report at http://bugs.php.net/?id=46090&edit=1
-- 
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46090&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46090&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46090&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=46090&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=46090&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=46090&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=46090&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=46090&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=46090&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=46090&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=46090&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=46090&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=46090&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46090&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=46090&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=46090&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=46090&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46090&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=46090&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=46090&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#129009) next »