#37471 [NEW]: Binding a cursor to a function that returns a cursor crashes PHP OCI

From: Date: Wed, 17 May 2006 06:31:30 +0000
Subject: #37471 [NEW]: Binding a cursor to a function that returns a cursor crashes PHP OCI
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-97240@lists.php.net to get a copy of this message
From: geoffwa at cs dot rmit dot edu dot au Operating system: Solaris 10 PHP version: 5.1.4 PHP Bug Type: OCI8 related Bug description: Binding a cursor to a function that returns a cursor crashes PHP OCI 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 bug report at http://bugs.php.net/?id=37471&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37471&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37471&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37471&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37471&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37471&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37471&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37471&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37471&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37471&r=support Expected behavior: http://bugs.php.net/fix.php?id=37471&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37471&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37471&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37471&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37471&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37471&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37471&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37471&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37471&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37471&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37471&r=mysqlcfg

« previous php.bugs (#97240) next »