Bug #70788 [Com]: calling multiple oci_free_statement results in segfault (11)

From: Date: Mon, 02 Nov 2015 21:16:48 +0000
Subject: Bug #70788 [Com]: calling multiple oci_free_statement results in segfault (11)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196985@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70788&edit=1

 ID:                 70788
 Comment by:         nick dot saraniti at gmail dot com
 Reported by:        nick dot saraniti at gmail dot com
 Summary:            calling multiple oci_free_statement results in
                     segfault (11)
 Status:             Feedback
 Type:               Bug
 Package:            OCI8 related
 Operating System:   Centos 6.7
 PHP Version:        7.0.0RC5
 Assigned To:        sixd
 Block user comment: N
 Private report:     N

 New Comment:

I ran into this problem with the Apache MOD_PHP SAPI, not CLI


Previous Comments:
------------------------------------------------------------------------
[2015-11-02 19:28:13] 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-10-26 00:42:31] nick dot saraniti at gmail dot com

Changed from pdo_oci to oci

------------------------------------------------------------------------
[2015-10-26 00:41:19] 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 />";



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=70788&edit=1


Thread (6 messages)

« previous php.bugs (#196985) next »