Bug #66633 [NEW]: Segmentation fault with odbc and bind params

From: Date: Mon, 03 Feb 2014 12:40:55 +0000
Subject: Bug #66633 [NEW]: Segmentation fault with odbc and bind params
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184132@lists.php.net to get a copy of this message
From: jeanseb Operating system: CentOS 6.5 PHP version: 5.4.24 Package: PDO ODBC Bug Type: Bug Bug description:Segmentation fault with odbc and bind params Description: ------------ I need to connect to a Microsoft SQL Server 2005 with PHP 5.4 on CentOS. A simple query with bind params does seg fault. I have try with unixOdbc 2.2.14 (unixODBC-2.2.14-12.el6_3.x86_64) et 2.3.0. $ php --version PHP 5.4.24 (cli) (built: Jan 9 2014 07:32:12) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans FreeTDS 0.91. $ $ cat /etc/odbcinst.ini [FreeTDS] Description = ODBC for MSSQL Driver = /usr/lib64/libtdsodbc.so.0 Setup = /usr/lib64/libtdsS.so.2 Test script: --------------- <?php $cnx = new PDO("odbc:DRIVER=FreeTDS;SERVER=*****,49503;DATABASE=****;MARS_Connection=yes;StripParmNames=yes;CallEscape=no", '***', '***'); $stmt = $cnx->prepare("select ID from AUDIT WHERE ID = ?"); $id = 1; $stmt->bindParam(1, $id, PDO::PARAM_INT); var_dump($stmt->execute()); var_dump($stmt->fetchAll(PDO::FETCH_NUM)); Expected result: ---------------- bool(true) Array ( [0] => Array ( [ID] => 1 ) ) Actual result: -------------- bool(true) Program received signal SIGSEGV, Segmentation fault. 0x00007fffd6c7ac8e in fetch_row (cl_statement=0xdac520, row_number=0, offset=0) at SQLExtendedFetch.c:103 103 SQLRETURN fetch_row( CLHSTMT cl_statement, int row_number, int offset ) Missing separate debuginfos, use: debuginfo-install libaio-0.3.107-10.el6.x86_64 libedit-2.11-4.20080712cvs.1.el6.x86_64 libicu-last-50.1.2-10.el6.remi.x86_64 libidn-1.18-2.el6.x86_64 libtool-ltdl-2.2.6-15.5.el6.x86_64 ncurses-libs-5.7-3.20090208.el6.x86_64 sqlite-3.7.9-1.el6.art.x86_64 (gdb) bt #0 0x00007fffd6c7ac8e in fetch_row (cl_statement=0xdac520, row_number=0, offset=0) at SQLExtendedFetch.c:103 #1 0x00007fffd6c7b0bc in fetch_rowset (cl_statement=0xdac520, rows_in_set=1, row_offset=0, fetched_rows=0x7fffffffa69c, row_status_array=0x0, rows_fetched_ptr=0x0) at SQLExtendedFetch.c:473 #2 0x00007fffd6c7b4d7 in do_fetch_scroll (cl_statement=0xdac520, fetch_orientation=1, fetch_offset=<value optimized out>, row_status_ptr=0x0, rows_fetched_ptr=<value optimized out>, ext_fetch=<value optimized out>) at SQLExtendedFetch.c:604 #3 0x00007fffe303eb85 in SQLFetchScroll (statement_handle=0xdacc20, fetch_orientation=1, fetch_offset=0) at SQLFetchScroll.c:273 #4 0x00007fffe27fd080 in odbc_stmt_fetch (stmt=0x7ffff7fd9e48, ori=<value optimized out>, offset=<value optimized out>) at /usr/src/debug/php-5.4.24/ext/pdo_odbc/odbc_stmt.c:528 #5 0x00007fffe2c13e24 in do_fetch_common (stmt=0x7ffff7fd9e48, ori=PDO_FETCH_ORI_NEXT, offset=<value optimized out>, do_bind=1) at /usr/src/debug/php-5.4.24/ext/pdo/pdo_stmt.c:700 #6 0x00007fffe2c13f4b in do_fetch (stmt=0x7ffff7fd9e48, return_value=0x7ffff7fda0d0, how=PDO_FETCH_NUM, ori=<value optimized out>, offset=<value optimized out>, return_all=0x0, do_bind=1) at /usr/src/debug/php-5.4.24/ext/pdo/pdo_stmt.c:867 #7 0x00007fffe2c15600 in zim_PDOStatement_fetchAll (ht=<value optimized out>, return_value=0x7ffff7fda0a0, return_value_ptr=<value optimized out>, this_ptr=<value optimized out>, return_value_used=<value optimized out>) at /usr/src/debug/php-5.4.24/ext/pdo/pdo_stmt.c:1540 #8 0x00007fffedaa758f in xdebug_execute_internal (current_execute_data=0x7ffff7fa4060, return_value_used=1) at /usr/src/debug/php-pecl-xdebug-2.2.3/xdebug-2.2.3/xdebug.c:1547 #9 0x000000000065e3d5 in zend_do_fcall_common_helper_SPEC (execute_data=<value optimized out>) at /usr/src/debug/php-5.4.24/Zend/zend_vm_execute.h:645 #10 0x000000000064bf58 in execute (op_array=0x7ffff7fd7a40) at /usr/src/debug/php-5.4.24/Zend/zend_vm_execute.h:410 #11 0x00007fffedaa79e9 in xdebug_execute (op_array=0x7ffff7fd7a40) at /usr/src/debug/php-pecl-xdebug-2.2.3/xdebug-2.2.3/xdebug.c:1435 #12 0x00000000005e1de0 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/debug/php-5.4.24/Zend/zend.c:1315 #13 0x0000000000584b18 in php_execute_script (primary_file=0x7fffffffd2f0) at /usr/src/debug/php-5.4.24/main/main.c:2502 #14 0x000000000068d8d3 in do_cli (argc=2, argv=0x7fffffffe648) at /usr/src/debug/php-5.4.24/sapi/cli/php_cli.c:989 #15 0x000000000068e098 in main (argc=2, argv=0x7fffffffe648) at /usr/src/debug/php-5.4.24/sapi/cli/php_cli.c:1365 -- Edit bug report at https://bugs.php.net/bug.php?id=66633&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66633&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66633&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66633&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66633&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66633&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66633&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66633&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66633&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66633&r=support Expected behavior: https://bugs.php.net/fix.php?id=66633&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66633&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66633&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66633&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66633&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66633&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66633&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66633&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66633&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66633&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66633&r=mysqlcfg

« previous php.bugs (#184132) next »