php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79611 PDO ODBC- Informix segfaults when fetching data using bound parameters
Submitted: 2020-05-18 17:47 UTC Modified: 2020-10-11 04:22 UTC
From: tom at advancedatatools dot com Assigned: cmb (profile)
Status: No Feedback Package: PDO ODBC
PHP Version: 7.4.6 OS: CentOS
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tom at advancedatatools dot com
New email:
PHP Version: OS:

 

 [2020-05-18 17:47 UTC] tom at advancedatatools dot com
Description:
------------
When doing a simple query using bound parameters php segfaults on the fetch line.
This happens for all tested data types, using named vs numbered bound parameters, and on every version of php tested (5.6, 7.2, 7.3).
This happens regardless of what it is fetching. 

This is using Informix as the back end engine. 



Test script:
---------------
$sth = $dbh->prepare("select item_num from items where item_num = ?");
$sth->bindParam(1,2);

#Works
$sth->execute();

#Segfaults for any type of fetch
$row = $sth->fetch(PDO::FETCH_NUM);



Expected result:
----------------
$row should return the record

Actual result:
--------------
Segmentation fault (core dumped)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-18 17:50 UTC] tom at advancedatatools dot com
Correction on test sql:
$sth = $dbh->prepare("select item_num from items where item_num = ?");
$vars = array(2);

#Works
$sth->execute($vars);

#Segfaults for any type of fetch
$row = $sth->fetch(PDO::FETCH_NUM);
 [2020-05-18 18:20 UTC] requinix@php.net
PHP 7.2 is no longer in active support.
https://www.php.net/supported-versions

If you can reproduce this in a current version, please include a backtrace of the crash.
http://bugs.php.net/bugs-generating-backtrace.php
 [2020-05-20 19:30 UTC] tom at advancedatatools dot com
-PHP Version: 7.2.31 +PHP Version: 7.4.6
 [2020-05-20 19:30 UTC] tom at advancedatatools dot com
Confirmed it still occurs in 7.4

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007fffed45bcaf in ?? () from /usr/lib/libodbccr.so
(gdb) bt
#0  0x00007fffed45bcaf in ?? () from /usr/lib/libodbccr.so
#1  0x00007fffed45c115 in ?? () from /usr/lib/libodbccr.so
#2  0x00007fffed45c555 in ?? () from /usr/lib/libodbccr.so
#3  0x00007ffff0a212d6 in SQLFetchScroll () from /usr/lib/x86_64-linux-gnu/libodbc.so.2
#4  0x00007ffff05fc64b in ?? () from /usr/lib/php/20190902/pdo_odbc.so
#5  0x00007ffff2887242 in ?? () from /usr/lib/php/20190902/pdo.so
#6  0x00007ffff288735a in ?? () from /usr/lib/php/20190902/pdo.so
#7  0x00007ffff2888b62 in ?? () from /usr/lib/php/20190902/pdo.so
#8  0x00005555558730d7 in execute_ex ()
#9  0x0000555555875752 in zend_execute ()
#10 0x00005555557e8fd2 in zend_execute_scripts ()
#11 0x0000555555787e50 in php_execute_script ()
#12 0x0000555555877743 in ?? ()
#13 0x00005555556428d6 in ?? ()
#14 0x00007ffff5c1fb97 in __libc_start_main (main=0x5555556424c0, argc=2, argv=0x7fffffffe578, init=<optimized out>, fini=<optimized out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffe568) at ../csu/libc-start.c:310
#15 0x0000555555642a7a in _start ()
 [2020-05-22 07:57 UTC] cmb@php.net
Thanks for checking with a current PHP version!

Could you provide a backtrace with debug symbols, and an ODBC
trace as well?
 [2020-09-29 12:01 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-09-29 12:01 UTC] cmb@php.net
Could you please provide a backtrace with debug symbols, and an
ODBC trace as well?
 [2020-10-11 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 18:01:23 2020 UTC