php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10144 Resource not properly freed after type intval(resource) type case
Submitted: 2001-04-03 14:23 UTC Modified: 2001-04-29 09:37 UTC
From: shmengie_2000 at yahoo dot com Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4.0 Latest CVS (01/04/2001) OS: NT, Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: shmengie_2000 at yahoo dot com
New email:
PHP Version: OS:

 

 [2001-04-03 14:23 UTC] shmengie_2000 at yahoo dot com
Summary:  WinNT, Apache 1.3.19,  recent snap, php_oci8.dll (possibly other db resources also)
Resource not releasted after casting to an integer.

Don't know if this the the culprit to my Apache server on windows constantly
crashing, but suspect it may be playing a role in it.

<?php
$connection = OCIPLogon ("scott","tiger","orcl");

echo "<br>First round:<br>";
$statement=OCIParse ($connection, "select user from dual");
//$result_value=intval($statement);  //CULPABLE.

echo var_dump($statement)."<br>Freed<br>";
@OCIFreeStatement($statement);
echo var_dump($statement)."<br>";

echo "<br>Second round:<br>";
$statement=OCIParse ($connection, "select user from dual");
$result_value=intval($statement);  //CULPRIT

echo var_dump($statement)."<br>Not Freed<br>";
@OCIFreeStatement($statement);
echo var_dump($statement)."<br>";
?>

Outputs:
First round:
resource(2) of type (oci8 statement)
Freed
resource(2) of type (Unknown)

Second round:
resource(3) of type (oci8 statement)
Not Freed
resource(3) of type (oci8 statement)

In the second round, the resource is not freed.

My Redhat Linux box (php 4.0.4pl1) doesn't crash, but the Windows version...  Well...

Background info:
Thought it would be a good idea to use Manuel Lemos'  Metabase.  Works great
on Linux.  That's where I developed this app, but now I need to migrate to a Windows platform and it's crashing like crazy.   Metabase's classes use an intval($resource) as a place holder, in an array of statement_info so that
you can run mutiple queries.  Metabase can keeps track of its queries this way (for OCI at least).

The crashes experienced catestrophic, but threads aren't closing up shop properly.  Bug #9857 came about because a constant would be still be defined the next page refresh.  Haven't been able to reproduce this in a short code segment w/out starting up metabase classes.  After using Metabase on windows however, all kinds of weirdness ensues.  Apache performs illegal instructions after every other refresh w/oci8 then.

-Joe "Shmengie"



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
For additional commands, e-mail: php-dev-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-29 09:36 UTC] shmengie_2000 at yahoo dot com
Fixed in latest cvs, thanks guys!!!
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat May 28 18:05:45 2022 UTC