php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70788 calling multiple oci_free_statement results in segfault (11)
Submitted: 2015-10-26 00:41 UTC Modified: 2015-11-22 04:22 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: nick dot saraniti at gmail dot com Assigned: sixd (profile)
Status: No Feedback Package: OCI8 related
PHP Version: 7.0.0RC5 OS: Centos 6.7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-10-26 00:41 UTC] nick dot saraniti at gmail dot com
Description:
------------
PHP 7RC5 
Centos 6.7
Oracle Instaclient 12.1 (from rpm) 
Apache/2.2.15

If you uncomment the oci_free_results() in the code below apache will segfault. If you only call oci_free_results() once, it does not.

Test script:
---------------
<?php
$SETTINGS_DB_username		=	"xxxxx";
$SETTINGS_DB_password		=	"xxxxx";
$SETTINGS_DB_ip			=	"10.10.10.202/XX";

// Connection String
if (!isset ($dbConx)) {
	$dbConx = oci_pconnect ( "$SETTINGS_DB_username", "$SETTINGS_DB_password", "$SETTINGS_DB_ip" );
}

function ORACLE_GET_MONTH()
{
	$SQL="SELECT TRUNC(SYSDATE, 'MONTH') AS MONTH FROM DUAL";
	$stmt = oci_parse ( $GLOBALS ['dbConx'], $SQL );
	oci_execute ( $stmt, OCI_DEFAULT );
	$result = oci_fetch_assoc ( $stmt );
	return $result['MONTH'];
	//oci_free_statement ( $stmt );
}

function ORACLE_GET_YEAR()
{
	$SQL="SELECT TRUNC(SYSDATE, 'YEAR') AS YEAR FROM DUAL";
	$stmt = oci_parse ( $GLOBALS ['dbConx'], $SQL );
	oci_execute ( $stmt, OCI_DEFAULT );
	$result = oci_fetch_assoc ( $stmt );
	return $result['YEAR'];
	//oci_free_statement ( $stmt );
}

$oci_month=ORACLE_GET_MONTH();
$oci_year=ORACLE_GET_YEAR();

echo "Month: $oci_month<br />";
echo "Year: $oci_year<br />";


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-26 00:42 UTC] nick dot saraniti at gmail dot com
-Package: PDO OCI +Package: Oracle related
 [2015-10-26 00:42 UTC] nick dot saraniti at gmail dot com
Changed from pdo_oci to oci
 [2015-10-26 03:17 UTC] laruence@php.net
-Assigned To: +Assigned To: sixd
 [2015-11-02 19:28 UTC] sixd@php.net
-Status: Assigned +Status: Feedback -Package: Oracle related +Package: OCI8 related
 [2015-11-02 19:28 UTC] sixd@php.net
Doesn't reproduce with cli SAPI in current 7.0 branch.  All, one or no oci_free_statement() calls have same behavior.
 [2015-11-02 21:16 UTC] nick dot saraniti at gmail dot com
I ran into this problem with the Apache MOD_PHP SAPI, not CLI
 [2015-11-08 20:39 UTC] sixd@php.net
Didn't reproduce with current 7.0 using Apache 2.4 on OS X.
Can you try again with the latest OCI8?
 [2015-11-22 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-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 01 07:03:34 2021 UTC