|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-05-14 04:13 UTC] dan at mutual dot io
[2011-06-10 19:31 UTC] sebastian dot foerster at konexxo dot de
[2012-07-29 18:07 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: mysql
[2012-07-30 09:50 UTC] johannes@php.net
-Status: Assigned
+Status: Feedback
[2012-07-30 09:50 UTC] johannes@php.net
[2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 23:00:02 2025 UTC |
Description: ------------ When using pdo_mysql compiled against libmysql, calling PDOStatement->execute in the given context results in a segmentation fault. Strangely, it's only when both columns `a` and `c` are selected that the segfault occurs, not when they are fetched independently. ~$ uname -a Linux karin 2.6.26-2-686 #1 SMP Thu Jan 27 00:28:05 UTC 2011 i686 GNU/Linux ~$ ldd /usr/local/lib/php/extensions/no-debug-zts-20090626/pdo_mysql.so linux-gate.so.1 => (0xb7712000) libmysqlclient_r.so.16 => /usr/local/mysql/lib/mysql/libmysqlclient_r.so.16 (0xb7696000) libz.so.1 => /usr/lib/libz.so.1 (0xb767b000) libcrypt.so.1 => /lib/i686/cmov/libcrypt.so.1 (0xb7648000) libnsl.so.1 => /lib/i686/cmov/libnsl.so.1 (0xb762f000) libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7609000) libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb75f0000) libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7495000) /lib/ld-linux.so.2 (0xb7713000) Please let me know if you require my `php --info`. Test script: --------------- <?php $connection = new PDO('mysql:host=localhost;port=3306;dbname=foo', 'foo', ''); $connection->exec("DROP TABLE IF EXISTS `system`"); $connection->exec(" CREATE TABLE `t` ( `a` varchar(255), `b` varchar(255), `c` varchar(255) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 "); $statement = $connection->prepare("SELECT a, c FROM t WHERE b = :b"); // segfault $statement->execute(array(':b' => 'blah')); ?> Expected result: ---------------- Test script should return 0. Actual result: -------------- ~$ gdb --args php pdo_mysql_segfault.php GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu"... (gdb) run Starting program: /usr/local/bin/php pdo_mysql_segfault.php [Thread debugging using libthread_db enabled] [New Thread 0xb718d6d0 (LWP 4010)] [New Thread 0xb6561b90 (LWP 4013)] [Thread 0xb6561b90 (LWP 4013) exited] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb718d6d0 (LWP 4010)] 0xb72244f3 in strlen () from /lib/i686/cmov/libc.so.6 (gdb) bt #0 0xb72244f3 in strlen () from /lib/i686/cmov/libc.so.6 #1 0xb6572764 in pdo_mysql_stmt_describe (stmt=0x996c83c, colno=0, tsrm_ls=0x97b4050) at /usr/local/src/php-5.3.6/ext/pdo_mysql/mysql_statement.c:700 #2 0xb6583032 in pdo_stmt_describe_columns (stmt=0x996c83c, tsrm_ls=0x97b4050) at /usr/local/src/php-5.3.6/ext/pdo/pdo_stmt.c:209 #3 0xb65856fe in zim_PDOStatement_execute (ht=1, return_value=0x996cad0, return_value_ptr=0x0, this_ptr=0x996b804, return_value_used=0, tsrm_ls=0x97b4050) at /usr/local/src/php-5.3.6/ext/pdo/pdo_stmt.c:519 #4 0x08348758 in zend_do_fcall_common_helper_SPEC (execute_data=0x999e798, tsrm_ls=0x97b4050) at /usr/local/src/php-5.3.6/Zend/zend_vm_execute.h:316 #5 0x08344089 in execute (op_array=0x996bcac, tsrm_ls=0x97b4050) at /usr/local/src/php-5.3.6/Zend/zend_vm_execute.h:107 #6 0x082f28c6 in zend_execute_scripts (type=8, tsrm_ls=0x97b4050, retval=0x0, file_count=3) at /usr/local/src/php-5.3.6/Zend/zend.c:1194 #7 0x08292890 in php_execute_script (primary_file=0xbfa7a708, tsrm_ls=0x97b4050) at /usr/local/src/php-5.3.6/main/main.c:2268 #8 0x08387c1a in main (argc=2, argv=0xbfa7a864) at /usr/local/src/php-5.3.6/sapi/cli/php_cli.c:1193