php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72424 Getting segmentation fault when using options for PDO driver
Submitted: 2016-06-15 20:16 UTC Modified: 2021-09-12 04:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: arif at dreamfactory dot com Assigned: cmb (profile)
Status: No Feedback Package: PDO_IBM (PECL)
PHP Version: 7.0.7 OS: Ubuntu 14.04.4 LTS
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-06-15 20:16 UTC] arif at dreamfactory dot com
Description:
------------
When creating a new instance of PDO (for PDO_IBM) using any options parameter I get segmentation fault but this works perfectly on php5.6.
The test script provided gives me segmentation fault when using php 7.0.7 but works fine using php 5.6.
However, if I remove the options parameter then it works in php 7.0.7. I get segmentation fault for using any options not just the ones shown in this code.

Test script:
---------------
$ibm = new PDO("ibm:DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME=192.168.1.11;DATABASE=TEST;", "user", "password", [
   PDO::ATTR_CASE => PDO::CASE_NATURAL,
   PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
]);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-07 14:55 UTC] ronyan at outlook dot com
See a workaround: ( pdo_ibm 1.3.5 ) ibm_driver.c:



980 #if PHP_MAJOR_VERSION >= 7
981                         if (Z_TYPE_P(data) == IS_STRING) {
982 #else	
983 			if (Z_TYPE_PP(data) == IS_STRING) {
984 #endif
985 				option_str = Z_STRVAL_PP(data); // <--- this line
986 			} else {
987 #if PHP_MAJOR_VERSION >= 7
988 				option_num = Z_LVAL_P(data);
989 #else
990 				option_num = Z_LVAL_PP(data);
991 #endif
992 			}

FIX:

981 #if PHP_MAJOR_VERSION >= 7
982                         if (Z_TYPE_P(data) == IS_STRING) {
983 #else	
984 			if (Z_TYPE_PP(data) == IS_STRING) {
985 #endif
986 //------------- fix ---------------
987 #if PHP_MAJOR_VERSION >= 7
988 				option_str = Z_STRVAL_P(data);
989 #else
990 				option_str = Z_STRVAL_PP(data);
991 #endif
    //------------- end fix ---------------
992 			} else {
993 #if PHP_MAJOR_VERSION >= 7
994 				option_num = Z_LVAL_P(data);
995 #else
996 				option_num = Z_LVAL_PP(data);
997 #endif
998 			}
 [2021-09-01 13:44 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-09-01 13:44 UTC] cmb@php.net
Is this still an issue with the latest PDO_IBM package (1.4.1)?
 [2021-09-12 04:22 UTC] pecl-dev 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-2021 The PHP Group
All rights reserved.
Last updated: Tue Sep 28 08:03:36 2021 UTC