ID:               37471
 User updated by:  geoffwa at cs dot rmit dot edu dot au
 Reported By:      geoffwa at cs dot rmit dot edu dot au
-Status:           Feedback
+Status:           Closed
 Bug Type:         OCI8 related
 Operating System: Solaris 10
 PHP Version:      5.1.4
 New Comment:

Test script available at:
http://goanna.cs.rmit.edu.au/~geoffwa/oci8_php_crash/test.phps

I was actually running this with PHP 5.1.2, as there wasn't any mention
of OCI fixes in the changelog of 5.1.3/4.

Having read the CVS tree, noticed the recent OCI module activity, built
PHP 5.1.4, and tested it again I can report that this is fixed for
5.1.4.


Previous Comments:
------------------------------------------------------------------------

[2006-05-17 06:49:00] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.



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

[2006-05-17 06:31:29] geoffwa at cs dot rmit dot edu dot au

Description:
------------
Binding a cursor to a PL/SQL function that returns a cursor causes a
segmentation fault in the PHP-OCI code when the PL/SQL function is
called more than once.

While this isn't a strictly correct, as it leaves a dangling cursor, it
doesn't crash PHP4 (which I am migrating from).

I've collected more information which is available at:
http://goanna.cs.rmit.edu.au/~geoffwa/oci8_php_crash/index.html


Reproduce code:
---------------
// Abbreivated example - assume connected $dbh and
// function that returns cursor
$query = "BEGIN :v_cursor := some_function(); END;";
$cursor = oci_new_cursor($dbh);
$sth = oci_parse($dbh, $query);
oci_bind_by_name($sth, ':v_cursor', $cursor,
   -1, OCI_B_CURSOR);
oci_execute($sth);
oci_execute($cursor);
oci_fetch_array($cursor);
oci_free_statment($sth);
oci_free_statment($cursor);
$sth = oci_parse($dbh, $query);
$cursor = oci_new_cursor($dbh);
oci_bind_by_name($sth, ':v_cursor', $cursor,
   -1, OCI_B_CURSOR);
oci_execute($sth); // <-- crash here
oci_execute($cursor);
oci_fetch_array($cursor);
oci_free_statment($sth);
oci_free_statment($cursor);

Expected result:
----------------
I expect the code to execute successfully, to not crash PHP, and to
cleanup the cursors when the database handle is closed.



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


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

Reply via email to