#42841 [NoF-Opn]: oci_new_cursor PHP crash
ID: 42841 User updated by: pr0head at gmail dot com Reported By: pr0head at gmail dot com -Status: No Feedback +Status: Open Bug Type: OCI8 related Operating System: Linux version 2.6.20-gentoo-r8 PHP Version: 5.2.4 New Comment: This script working normally if not reopen cursor. Bad result: $sql = BEGIN sp_vadik_1( :cursor ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); oci_free_statement( $stmt ); oci_free_statement( $cursor ); $sql = BEGIN sp_vadik_1( :cursor ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); oci_free_statement( $stmt ); oci_free_statement( $cursor ); Good result: $sql = BEGIN sp_vadik_1( :cursor ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); oci_free_statement( $stmt ); $sql = BEGIN sp_vadik_1( :cursor ); END;; $stmt = oci_parse( $connection, $sql ); oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); oci_free_statement( $stmt ); oci_free_statement( $cursor ); Previous Comments: [2007-11-20 01:00:00] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2007-11-12 10:35:02] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php for *NIX and http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32 Once you have generated a backtrace, please submit it to this bug report and change the status back to Open. Thank you for helping us make PHP better. [2007-10-04 08:38:08] pr0head at gmail dot com stop work - this crash PHP. If run this script in command line, i see error segmentation false [2007-10-04 08:27:01] pr0head at gmail dot com Sorry, need change lines in EXECUTE 2 (for reproduction errors). SQL and bind param must be the same for both executions: $sql = BEGIN sp_vadik_1( :cursor ); END;; oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); [2007-10-04 08:14:28] pr0head at gmail dot com ?php /** * ORACLE Storage Procedure * * create or replace procedure sp_vadik_1 ( out_1 out sys_refcursor ) is begin * open out_1 for select 11 from dual union all select 12 from dual union all select 13 from dual; * end sp_vadik_1; */ $params_db = array( 'host' = localhost, 'username' = username, 'password' = password, 'dbname' = db ); putenv( 'ORACLE_SID=' . $params_db['dbname'] ); $conn_string = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=' . $params_db['host'] . ')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=' . $params_db['dbname'] . ')))'; $connection = @oci_connect( $params_db['username'], $params_db['password'], $conn_string ); // START EXECUTE 1 ---// $sql = BEGIN sp_vadik_1( :cursor ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); while( $row = oci_fetch_array( $cursor, OCI_ASSOC + OCI_RETURN_LOBS ) ) { $data[] = $row; } oci_free_statement( $stmt ); oci_free_statement( $cursor ); // STOP EXECUTE 1 ---// // START EXECUTE 2 ---// $sql = BEGIN sp_vadik_1( :cursor1 ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor1, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); while( $row = oci_fetch_array( $cursor, OCI_ASSOC + OCI_RETURN_LOBS ) ) { $data[] = $row; } oci_free_statement( $stmt ); oci_free_statement( $cursor ); var_dump($cur2); // STOP EXECUTE 2 ---// oci_close( $connection ); ? The remainder of the comments for this report
#42841 [Fbk-Opn]: oci_new_cursor PHP crash
ID: 42841 User updated by: pr0head at gmail dot com Reported By: pr0head at gmail dot com -Status: Feedback +Status: Open Bug Type: OCI8 related Operating System: Linux version 2.6.20-gentoo-r8 PHP Version: 5.2.4 New Comment: ?php /** * ORACLE Storage Procedure * * create or replace procedure sp_vadik_1 ( out_1 out sys_refcursor ) is begin * open out_1 for select 11 from dual union all select 12 from dual union all select 13 from dual; * end sp_vadik_1; */ $params_db = array( 'host' = localhost, 'username' = username, 'password' = password, 'dbname' = db ); putenv( 'ORACLE_SID=' . $params_db['dbname'] ); $conn_string = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=' . $params_db['host'] . ')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=' . $params_db['dbname'] . ')))'; $connection = @oci_connect( $params_db['username'], $params_db['password'], $conn_string ); // START EXECUTE 1 ---// $sql = BEGIN sp_vadik_1( :cursor ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); while( $row = oci_fetch_array( $cursor, OCI_ASSOC + OCI_RETURN_LOBS ) ) { $data[] = $row; } oci_free_statement( $stmt ); oci_free_statement( $cursor ); // STOP EXECUTE 1 ---// // START EXECUTE 2 ---// $sql = BEGIN sp_vadik_1( :cursor1 ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor1, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); while( $row = oci_fetch_array( $cursor, OCI_ASSOC + OCI_RETURN_LOBS ) ) { $data[] = $row; } oci_free_statement( $stmt ); oci_free_statement( $cursor ); var_dump($cur2); // STOP EXECUTE 2 ---// oci_close( $connection ); ? Previous Comments: [2007-10-04 00:27:17] [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 the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. + | I couldn't reproduce it. | Thanks for reporting the bug, but please include a complete | testcase so I don't have to guess what the code might be. | Also, what does stop work mean? + [2007-10-03 15:39:01] pr0head at gmail dot com Description: If you have two or more times the same stored procedure where the cursor name the same ( :cursor ), PHP stop work. Reproduce code: --- $connection = oci_connect( ); // First execute SP $sql = BEGIN sp_vadik_1( :cursor ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); while( $row = oci_fetch_array( $cursor ) ) { } oci_free_statement( $stmt ); oci_free_statement( $cursor ); Expected result: If the cursor names are not different ( first - :cursor1, second - :cursor2), the challenges are successful. If not cleaned cursor to the first call, and declare it in the second, the queries are also successful. -- Edit this bug report at http://bugs.php.net/?id=42841edit=1
#42841 [Opn]: oci_new_cursor PHP crash
ID: 42841 User updated by: pr0head at gmail dot com Reported By: pr0head at gmail dot com Status: Open Bug Type: OCI8 related Operating System: Linux version 2.6.20-gentoo-r8 PHP Version: 5.2.4 New Comment: Sorry, need change lines in EXECUTE 2 (for reproduction errors). SQL and bind param must be the same for both executions: $sql = BEGIN sp_vadik_1( :cursor ); END;; oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); Previous Comments: [2007-10-04 08:14:28] pr0head at gmail dot com ?php /** * ORACLE Storage Procedure * * create or replace procedure sp_vadik_1 ( out_1 out sys_refcursor ) is begin * open out_1 for select 11 from dual union all select 12 from dual union all select 13 from dual; * end sp_vadik_1; */ $params_db = array( 'host' = localhost, 'username' = username, 'password' = password, 'dbname' = db ); putenv( 'ORACLE_SID=' . $params_db['dbname'] ); $conn_string = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=' . $params_db['host'] . ')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=' . $params_db['dbname'] . ')))'; $connection = @oci_connect( $params_db['username'], $params_db['password'], $conn_string ); // START EXECUTE 1 ---// $sql = BEGIN sp_vadik_1( :cursor ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); while( $row = oci_fetch_array( $cursor, OCI_ASSOC + OCI_RETURN_LOBS ) ) { $data[] = $row; } oci_free_statement( $stmt ); oci_free_statement( $cursor ); // STOP EXECUTE 1 ---// // START EXECUTE 2 ---// $sql = BEGIN sp_vadik_1( :cursor1 ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor1, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); while( $row = oci_fetch_array( $cursor, OCI_ASSOC + OCI_RETURN_LOBS ) ) { $data[] = $row; } oci_free_statement( $stmt ); oci_free_statement( $cursor ); var_dump($cur2); // STOP EXECUTE 2 ---// oci_close( $connection ); ? [2007-10-04 00:27:17] [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 the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. + | I couldn't reproduce it. | Thanks for reporting the bug, but please include a complete | testcase so I don't have to guess what the code might be. | Also, what does stop work mean? + [2007-10-03 15:39:01] pr0head at gmail dot com Description: If you have two or more times the same stored procedure where the cursor name the same ( :cursor ), PHP stop work. Reproduce code: --- $connection = oci_connect( ); // First execute SP $sql = BEGIN sp_vadik_1( :cursor ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); while( $row = oci_fetch_array( $cursor ) ) { } oci_free_statement( $stmt ); oci_free_statement( $cursor ); Expected result: If the cursor names are not different ( first - :cursor1, second - :cursor2), the challenges are successful. If not cleaned cursor to the first call, and declare it in the second, the queries are also successful. -- Edit this bug report at http://bugs.php.net/?id=42841edit=1
#42841 [Opn]: oci_new_cursor PHP crash
ID: 42841 User updated by: pr0head at gmail dot com Reported By: pr0head at gmail dot com Status: Open Bug Type: OCI8 related Operating System: Linux version 2.6.20-gentoo-r8 PHP Version: 5.2.4 New Comment: stop work - this crash PHP. If run this script in command line, i see error segmentation false Previous Comments: [2007-10-04 08:27:01] pr0head at gmail dot com Sorry, need change lines in EXECUTE 2 (for reproduction errors). SQL and bind param must be the same for both executions: $sql = BEGIN sp_vadik_1( :cursor ); END;; oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); [2007-10-04 08:14:28] pr0head at gmail dot com ?php /** * ORACLE Storage Procedure * * create or replace procedure sp_vadik_1 ( out_1 out sys_refcursor ) is begin * open out_1 for select 11 from dual union all select 12 from dual union all select 13 from dual; * end sp_vadik_1; */ $params_db = array( 'host' = localhost, 'username' = username, 'password' = password, 'dbname' = db ); putenv( 'ORACLE_SID=' . $params_db['dbname'] ); $conn_string = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=' . $params_db['host'] . ')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=' . $params_db['dbname'] . ')))'; $connection = @oci_connect( $params_db['username'], $params_db['password'], $conn_string ); // START EXECUTE 1 ---// $sql = BEGIN sp_vadik_1( :cursor ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); while( $row = oci_fetch_array( $cursor, OCI_ASSOC + OCI_RETURN_LOBS ) ) { $data[] = $row; } oci_free_statement( $stmt ); oci_free_statement( $cursor ); // STOP EXECUTE 1 ---// // START EXECUTE 2 ---// $sql = BEGIN sp_vadik_1( :cursor1 ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor1, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); while( $row = oci_fetch_array( $cursor, OCI_ASSOC + OCI_RETURN_LOBS ) ) { $data[] = $row; } oci_free_statement( $stmt ); oci_free_statement( $cursor ); var_dump($cur2); // STOP EXECUTE 2 ---// oci_close( $connection ); ? [2007-10-04 00:27:17] [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 the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. + | I couldn't reproduce it. | Thanks for reporting the bug, but please include a complete | testcase so I don't have to guess what the code might be. | Also, what does stop work mean? + [2007-10-03 15:39:01] pr0head at gmail dot com Description: If you have two or more times the same stored procedure where the cursor name the same ( :cursor ), PHP stop work. Reproduce code: --- $connection = oci_connect( ); // First execute SP $sql = BEGIN sp_vadik_1( :cursor ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); while( $row = oci_fetch_array( $cursor ) ) { } oci_free_statement( $stmt ); oci_free_statement( $cursor ); Expected result: If the cursor names are not different ( first - :cursor1, second - :cursor2), the challenges are successful. If not cleaned cursor to the first call, and declare it in the second, the queries are also successful. -- Edit this bug report at http://bugs.php.net/?id=42841edit=1
#42841 [NEW]: oci_new_cursor PHP crash
From: pr0head at gmail dot com Operating system: Linux version 2.6.20-gentoo-r8 PHP version: 5.2.4 PHP Bug Type: OCI8 related Bug description: oci_new_cursor PHP crash Description: If you have two or more times the same stored procedure where the cursor name the same ( :cursor ), PHP stop work. Reproduce code: --- $connection = oci_connect( ); // First execute SP $sql = BEGIN sp_vadik_1( :cursor ); END;; $stmt = oci_parse( $connection, $sql ); $cursor = oci_new_cursor( $connection ); oci_bind_by_name( $stmt, :cursor, $cursor, -1, OCI_B_CURSOR ); oci_execute( $stmt, OCI_DEFAULT ); oci_execute( $cursor ); while( $row = oci_fetch_array( $cursor ) ) { } oci_free_statement( $stmt ); oci_free_statement( $cursor ); Expected result: If the cursor names are not different ( first - :cursor1, second - :cursor2), the challenges are successful. If not cleaned cursor to the first call, and declare it in the second, the queries are also successful. -- Edit bug report at http://bugs.php.net/?id=42841edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42841r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42841r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42841r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42841r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42841r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42841r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=42841r=needscript Try newer version:http://bugs.php.net/fix.php?id=42841r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42841r=support Expected behavior:http://bugs.php.net/fix.php?id=42841r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42841r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42841r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42841r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42841r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42841r=dst IIS Stability:http://bugs.php.net/fix.php?id=42841r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42841r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42841r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42841r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=42841r=mysqlcfg