|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-04-01 11:20 UTC] s dot rost at ewerk dot com
Description: ------------ When fetching rows from a table containing LOB columns more than once (!) pdo_oci or the oracle instantclient crashes, resets the server connection and aborts the PHP script. It seems like when the fetched row gets out of scope and should be garbage collected the error occurs. Reproduce code: --------------- See http://public.serenity.de/pdo_oci_test.txt Replace XXX, YYY and scott/tiger with valid connection data and the script will do the rest. Expected result: ---------------- 864 864 864 864 this line is never reached Actual result: -------------- 864 864 Aborted PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 13:00:02 2025 UTC |
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1245628192 (LWP 13277)] 0xb79b3a5e in kghufree () from /opt/oracle/instantclient/libclntsh.so.11.1 (gdb) bt #0 0xb79b3a5e in kghufree () from /opt/oracle/instantclient/libclntsh.so.11.1 #1 0xb79a83a6 in kohfrem () from /opt/oracle/instantclient/libclntsh.so.11.1 #2 0xb79a7b3b in kohfrr () from /opt/oracle/instantclient/libclntsh.so.11.1 #3 0xb68dfe48 in kohfrw () from /opt/oracle/instantclient/libclntsh.so.11.1 #4 0xb685b010 in kollfrfn () from /opt/oracle/instantclient/libclntsh.so.11.1 #5 0xb63f5379 in kpufdesc2 () from /opt/oracle/instantclient/libclntsh.so.11.1 #6 0xb63f4bb1 in kpufdesc () from /opt/oracle/instantclient/libclntsh.so.11.1 #7 0xb63ce20e in OCIDescriptorFree () from /opt/oracle/instantclient/libclntsh.so.11.1 #8 0x08171a7e in oci_blob_close (stream=0xb5be08d0, close_handle=1) at /var/install/source/php-5.2.5/ext/pdo_oci/oci_statement.c:652 #9 0x0837cbdc in _php_stream_free (stream=0xb5be08d0, close_options=11) at /var/install/source/php-5.2.5/main/streams/streams.c:346 #10 0x0837ef17 in stream_resource_regular_dtor (rsrc=0xb5be06bc) at /var/install/source/php-5.2.5/main/streams/streams.c:1369 #11 0x083c85a0 in list_entry_destructor (ptr=0xb5be06bc) at /var/install/source/php-5.2.5/Zend/zend_list.c:184 #12 0x083c5d9a in zend_hash_del_key_or_index (ht=0x852c7e8, arKey=0x0, nKeyLength=0, h=11, flag=1) at /var/install/source/php-5.2.5/Zend/zend_hash.c:497 #13 0x083c825b in _zend_list_delete (id=11) at /var/install/source/php-5.2.5/Zend/zend_list.c:58 #14 0x083b7e54 in _zval_dtor_func (zvalue=0xb5be0858, __zend_filename=0x84f9ebc "/var/install/source/php- 5.2.5/Zend/zend_variables.h", __zend_lineno=35) at /var/install/source/php-5.2.5/Zend/zend_variables.c:60 #15 0x083aa842 in _zval_dtor (zvalue=0xb5be0858, __zend_filename=0x84f9e48 "/var/install/source/php- 5.2.5/Zend/zend_execute_API.c", __zend_lineno=414) at /var/install/source/php-5.2.5/Zend/zend_variables.h:35 #16 0x083aaa00 in _zval_ptr_dtor (zval_ptr=0xb5be09d8, __zend_filename=0x84faf94 "/var/install/source/php- 5.2.5/Zend/zend_variables.c", __zend_lineno=175) at /var/install/source/php-5.2.5/Zend/zend_execute_API.c:414 #17 0x083b81b4 in _zval_ptr_dtor_wrapper (zval_ptr=0xb5be09d8) at /var/install/source/php-5.2.5/Zend/zend_variables.c:175 #18 0x083c5ee5 in zend_hash_destroy (ht=0xb5be07b4) at /var/install/source/php-5.2.5/Zend/zend_hash.c:526 #19 0x083b7e05 in _zval_dtor_func (zvalue=0xb5be0680, __zend_filename=0x84fe2a8 "/var/install/source/php- 5.2.5/Zend/zend_variables.h", __zend_lineno=35) at /var/install/source/php-5.2.5/Zend/zend_variables.c:43 #20 0x083de15b in _zval_dtor (zvalue=0xb5be0680, __zend_filename=0x84fe274 "/var/install/source/php- 5.2.5/Zend/zend_execute.c", __zend_lineno=811) at /var/install/source/php-5.2.5/Zend/zend_variables.h:35 #21 0x083e2203 in zend_assign_to_variable (result=0xb5be2834, op1=0xb5be2848, op2=0xb5be285c, value=0xb5bde518, type=4, Ts=0xbf8a01d0) at /var/install/source/php- 5.2.5/Zend/zend_execute.c:811 ---Type <return> to continue, or q <return> to quit--- #22 0x0842abbe in ZEND_ASSIGN_SPEC_CV_VAR_HANDLER (execute_data=0xbf8a0554) at /var/install/source/php-5.2.5/Zend/zend_vm_execute.h:24176 #23 0x083dec8c in execute (op_array=0xb5bddea8) at /var/install/source/php-5.2.5/Zend/zend_vm_execute.h:92 #24 0x083ba1ab in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /var/install/source/php-5.2.5/Zend/zend.c:1134 #25 0x083691b6 in php_execute_script (primary_file=0xbf8a28f0) at /var/install/source/php-5.2.5/main/main.c:2004 #26 0x08433966 in main (argc=2, argv=0xbf8a2a34) at /var/install/source/php-5.2.5/sapi/cli/php_cli.c:1140I have a very similar problem. Segfaults when executing two exactly same queries each after another. The query must contain a JOIN and one of the tables a CLOB (if it is against a single table without a join works fine). If the query is executed only once it works. ============== CODE =========== <? $db = new \PDO('oci:host=192.168.1.231;port=1521;dbname=192.168.1.231/orcl;charset=AL32UTF8','user','pass'); $q = " SELECT clob_column FROM table1 INNER JOIN table2 ON table2.tid=table1.tid WHERE main_table.tid = :tid "; $b = array('tid'=>1); $s = $db->prepare($q); $s->execute($b); $data = $s->fetchAll(); $q = " SELECT clob_column FROM table1 INNER JOIN table2 ON table2.tid=table1.tid WHERE main_table.tid = :tid "; $b = array('tid'=>1); $s = $db->prepare($q); $s->execute($b); $data = $s->fetchAll(); print 'ok';//never reached ?> =================== CONFIGURE OPTIONS =========== './configure' '--prefix=/web/php5.3-debug' '--with-apxs2=/web/apache2.2-php5.3-debug/bin/apxs' '--enable-bcmath=shared' '--with-bz2=shared' '--enable-calendar=shared' '--with-curl=shared' '--enable-dbase=shared' '--enable-dbx=shared' '--enable-exif=shared' '--with-fam=shared' '--with-gettext=shared' '--with-gmp=shared' '--with-iconv=shared' '--with-gd=shared' '--with-ttf' '--with-freetype-dir' '--enable-gd-native-ttf' '--with-jpeg-dir' '--with-png-dir' '--with-xpm-dir--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-ldap-sasl' '--with-mcal=shared' '--with-mcrypt=shared' '--with-mhash=shared' '--enable-mbstring=shared' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' '--with-ncurses=shared' '--with-openssl=shared' '--enable-pcntl=shared' '--with-pgsql=shared,/usr/bin/pg_config' '--with-imap=shared' '--with-imap-ssl' '--with-oci8=shared,instantclient,/opt/oracle_instantclient_11,11.1.0.6.0' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--enable-sysvmsg=shared' '--enable-shmop' '--enable-mbstring' '--with-zlib=shared' '--with-bz2=shared' '--with-xsl=shared' '--with-pdo-mysql=shared' '--with-pdo-pgsql=shared' '--with-pdo-oci=shared,instantclient,/opt/oracle_instantclient_11,11.1.0.6.0' '--enable-debug' =================== BACKTRACE ============== #0 0x00002b46f4b7148c in kohfri () from /opt/oracle_instantclient_11/libclntsh.so.11.1 #1 0x00002b46f5fe1fd1 in kohfrr () from /opt/oracle_instantclient_11/libclntsh.so.11.1 #2 0x00002b46f4b710e2 in kohfrw () from /opt/oracle_instantclient_11/libclntsh.so.11.1 #3 0x00002b46f4abdbeb in kollfrfn () from /opt/oracle_instantclient_11/libclntsh.so.11.1 #4 0x00002b46f47d472e in kpufdesc2 () from /opt/oracle_instantclient_11/libclntsh.so.11.1 #5 0x00002b46f47d3ebb in kpufdesc () from /opt/oracle_instantclient_11/libclntsh.so.11.1 #6 0x00002b46f47a8af9 in OCIDescriptorFree () from /opt/oracle_instantclient_11/libclntsh.so.11.1 #7 0x00002b46f7621aa6 in oci_blob_close (stream=0xa94680, close_handle=1) at /home/DATA/temp_compile/php-5.3.0/ext/pdo_oci/oci_statement.c:652 #8 0x00002b46f0cc1105 in _php_stream_free (stream=0xa94680, close_options=11) at /home/DATA/temp_compile/php-5.3.0/main/streams/streams.c:356 #9 0x00002b46f0cc3d7d in stream_resource_regular_dtor (rsrc=0xa94868) at /home/DATA/temp_compile/php-5.3.0/main/streams/streams.c:1426 #10 0x00002b46f0d35e38 in list_entry_destructor (ptr=0xa94868) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_list.c:184 #11 0x00002b46f0d32d7b in zend_hash_del_key_or_index (ht=0x2b46f15286b0, arKey=0x0, nKeyLength=0, h=3, flag=1) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_hash.c:497 #12 0x00002b46f0d35905 in _zend_list_delete (id=3) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_list.c:58 #13 0x00002b46f0d1fd57 in _zval_dtor_func (zvalue=0xa94590, __zend_filename=0x2b46f1224d28 "/home/DATA/temp_compile/php-5.3.0/Zend/zend_execute_API.c", __zend_lineno=435) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_variables.c:60 #14 0x00002b46f0d0f6d5 in _zval_dtor (zvalue=0xa94590, __zend_filename=0x2b46f1224d28 "/home/DATA/temp_compile/php-5.3.0/Zend/zend_execute_API.c", __zend_lineno=435) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_variables.h:35 #15 0x00002b46f0d0f9fc in _zval_ptr_dtor (zval_ptr=0xa94990, __zend_filename=0x2b46f1225e80 "/home/DATA/temp_compile/php-5.3.0/Zend/zend_variables.c", __zend_lineno=175) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_execute_API.c:435 #16 0x00002b46f0d20106 in _zval_ptr_dtor_wrapper (zval_ptr=0xa94990) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_variables.c:175 #17 0x00002b46f0d32ece in zend_hash_destroy (ht=0xa94458) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_hash.c:526 #18 0x00002b46f0d1fd10 in _zval_dtor_func (zvalue=0xa943e0, __zend_filename=0x2b46f1224d28 "/home/DATA/temp_compile/php-5.3.0/Zend/zend_execute_API.c", __zend_lineno=435) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_variables.c:43 #19 0x00002b46f0d0f6d5 in _zval_dtor (zvalue=0xa943e0, __zend_filename=0x2b46f1224d28 "/home/DATA/temp_compile/php-5.3.0/Zend/zend_execute_API.c", __zend_lineno=435) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_variables.h:35 #20 0x00002b46f0d0f9fc in _zval_ptr_dtor (zval_ptr=0xa94a30, __zend_filename=0x2b46f1225e80 "/home/DATA/temp_compile/php-5.3.0/Zend/zend_variables.c", __zend_lineno=175) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_execute_API.c:435 #21 0x00002b46f0d20106 in _zval_ptr_dtor_wrapper (zval_ptr=0xa94a30) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_variables.c:175 #22 0x00002b46f0d32ece in zend_hash_destroy (ht=0xa94208) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_hash.c:526 #23 0x00002b46f0d1fd10 in _zval_dtor_func (zvalue=0xa93468, __zend_filename=0x2b46f1229b38 "/home/DATA/temp_compile/php-5.3.0/Zend/zend_execute.c", __zend_lineno=698) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_variables.c:43 #24 0x00002b46f0d5195d in _zval_dtor (zvalue=0xa93468, __zend_filename=0x2b46f1229b38 "/home/DATA/temp_compile/php-5.3.0/Zend/zend_execute.c", __zend_lineno=698) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_variables.h:35 #25 0x00002b46f0d89dee in zend_assign_to_variable (variable_ptr_ptr=0xa94b48, value=0xa929e0, is_tmp_var=0) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_execute.c:698 #26 0x00002b46f0e014e0 in ZEND_ASSIGN_SPEC_CV_VAR_HANDLER (execute_data=0x2b46fd11f090) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_vm_execute.h:27263 #27 0x00002b46f0d540ee in execute (op_array=0xa8f240) at /home/DATA/temp_compile/php-5.3.0/Zend/zend_vm_execute.h:104 #28 0x00002b46f0d229db in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/DATA/temp_compile/php-5.3.0/Zend/zend.c:1188 #29 0x00002b46f0ca6c6c in php_execute_script (primary_file=0x7fffc2c2ca30) at /home/DATA/temp_compile/php-5.3.0/main/main.c:2196 #30 0x00002b46f0e11fc6 in php_handler (r=0xac6878) at /home/DATA/temp_compile/php-5.3.0/sapi/apache2handler/sapi_apache2.c:648 #31 0x000000000044151c in ap_run_handler () #32 0x0000000000441db5 in ap_invoke_handler () #33 0x0000000000452600 in ap_process_request () #34 0x000000000044f5e1 in ap_process_http_connection () #35 0x000000000044a89a in ap_run_process_connection () #36 0x000000000044acd4 in ap_process_connection () #37 0x0000000000458f47 in child_main () #38 0x00000000004590ed in make_child () #39 0x000000000045915b in startup_children () #40 0x0000000000459615 in ap_mpm_run