|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-03-03 20:13 UTC] jreed at myers dot com
Description:
------------
When oci8.default_prefetch is set to anything but zero, executing a SQL statement that uses a dbLink and only returns a single row causes Apache to seg fault. If oci8.default_prefetch is set to zero then it works fine. This problem only seems to occur if you do a SELECT *. If you identify the exact columns to select then it works fine. Also, the same statement works fine, even with SELECT *, if you connect to the database directly. It only fails if accessing through a dbLink.
Reproduce code:
---------------
$sql = "
select
*
from
my_schema.my_table@my_db_link
where
table_id = $some_id
";
$stmt = ociparse($conn, $sql);
ociexecute($stmt, OCI_DEFAULT);
ocifetchinto($stmt, $row, OCI_ASSOC);
ocifreestatement($stmt);
Expected result:
----------------
$row is a populated associative array with all the columns from the table row requested.
Actual result:
--------------
Apache seg faults immediately after the ociexecute() call.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 09:00:01 2025 UTC |
Using latest PHP snapshot php5.1-200603062130 w/ OCI8 module $Revision: 1.269.2.10 $ Apache v2.2.0 Oracle Instant Client v10.2 SQL query still results in seg fault. Here is the backtrace: Detaching after fork from child process 17169. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -150749056 (LWP 17160)] 0x052373da in ttcfopr () from /usr/local/instantclient/lib/libclntsh.so.10.1 (gdb) (gdb) bt #0 0x052373da in ttcfopr () from /usr/local/instantclient/lib/libclntsh.so.10.1 #1 0x0522e698 in ttcdrv () from /usr/local/instantclient/lib/libclntsh.so.10.1 #2 0x05114ec5 in nioqwa () from /usr/local/instantclient/lib/libclntsh.so.10.1 #3 0x04f82d97 in upirtrc () from /usr/local/instantclient/lib/libclntsh.so.10.1 #4 0x04ef8a36 in kpurcsc () from /usr/local/instantclient/lib/libclntsh.so.10.1 #5 0x04eae07b in kpuexecv8 () from /usr/local/instantclient/lib/libclntsh.so.10.1 #6 0x04eb040a in kpuexec () from /usr/local/instantclient/lib/libclntsh.so.10.1 #7 0x04f87902 in OCIStmtExecute () from /usr/local/instantclient/lib/libclntsh.so.10.1 #8 0x002fa205 in php_oci_statement_execute (statement=0x949ca8c, mode=155822076) at /root/php5.1-200603062130/ext/oci8/oci8_statement.c:321 #9 0x002ff712 in zif_oci_execute (ht=2, return_value=0x957fccc, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0) at /root/php5.1-200603062130/ext/oci8/oci8_interface.c:1276 #10 0x0120772d in zend_do_fcall_common_helper_SPEC (execute_data=0xfef25690) at zend_vm_execute.h:192 #11 0x004c73ef in get_module () from /usr/local/Zend/lib/Optimizer-2_6_1/php-5.1.x/ZendOptimizer.so #12 0xfef25690 in ?? () #13 0xfef25690 in ?? () #14 0x00000001 in ?? () #15 0x09319308 in ?? () #16 0xfef255d4 in ?? () #17 0x00000000 in ?? ()Here's the backtrace with all Zend extensions removed/turned off: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -150626176 (LWP 20044)] 0x020683da in ttcfopr () from /usr/local/instantclient/lib/libclntsh.so.10.1 (gdb) bt #0 0x020683da in ttcfopr () from /usr/local/instantclient/lib/libclntsh.so.10.1 #1 0x0205f698 in ttcdrv () from /usr/local/instantclient/lib/libclntsh.so.10.1 #2 0x01f45ec5 in nioqwa () from /usr/local/instantclient/lib/libclntsh.so.10.1 #3 0x01db3d97 in upirtrc () from /usr/local/instantclient/lib/libclntsh.so.10.1 #4 0x01d29a36 in kpurcsc () from /usr/local/instantclient/lib/libclntsh.so.10.1 #5 0x01cdf07b in kpuexecv8 () from /usr/local/instantclient/lib/libclntsh.so.10.1 #6 0x01ce140a in kpuexec () from /usr/local/instantclient/lib/libclntsh.so.10.1 #7 0x01db8902 in OCIStmtExecute () from /usr/local/instantclient/lib/libclntsh.so.10.1 #8 0x00476205 in php_oci_statement_execute (statement=0x862fa5c, mode=140695500) at /root/php5.1-200603062130/ext/oci8/oci8_statement.c:321 #9 0x0047b712 in zif_oci_execute (ht=2, return_value=0x871c724, return_value_ptr=0x0, this_ptr=0x0, return_value_used=0) at /root/php5.1-200603062130/ext/oci8/oci8_interface.c:1276 #10 0x011f472d in zend_do_fcall_common_helper_SPEC (execute_data=0xfef46920) at zend_vm_execute.h:192 #11 0x011f40a1 in execute (op_array=0x8606cd8) at zend_vm_execute.h:92 #12 0x011f452f in zend_do_fcall_common_helper_SPEC (execute_data=0xfef4df30) at zend_vm_execute.h:226 #13 0x011f40a1 in execute (op_array=0x85be084) at zend_vm_execute.h:92 #14 0x011df7be in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/php-5.1.2/Zend/zend.c:1101 #15 0x011aef24 in php_execute_script (primary_file=0xfef50270) at /root/php-5.1.2/main/main.c:1720 #16 0x01236f08 in php_handler (r=0x85ab410) at /root/php-5.1.2/sapi/apache2handler/sapi_apache2.c:584 #17 0x080765b2 in ap_run_handler (r=0x85ab410) at config.c:157 #18 0x08076ac6 in ap_invoke_handler (r=0x85ab410) at config.c:371 #19 0x08092eff in ap_process_request (r=0x85ab410) at http_request.c:258 #20 0x08090fd1 in ap_process_http_connection (c=0x85a5238) at http_core.c:171 #21 0x0807bb02 in ap_run_process_connection (c=0x85a5238) at connection.c:43 #22 0x080a09f7 in child_main (child_num_arg=0) at prefork.c:640 #23 0x080a0af0 in make_child (s=0x83d1fd0, slot=0) at prefork.c:680 #24 0x080a1531 in ap_mpm_run (_pconf=0x83cd0a8, plog=0x8409198, s=0x83d1fd0) at prefork.c:956 #25 0x08066f5c in main (argc=2, argv=0xfef50634) at main.c:712