ID: 37931
User updated by: Olaf dot Imig at bifab dot de
Reported By: Olaf dot Imig at bifab dot de
-Status: Feedback
+Status: Open
Bug Type: OCI8 related
Operating System: Linux(x86)/Solaris(sparc)
PHP Version: 5.1.4
New Comment:
No, this patch isn't the full solution. Setting connection->is_open to
0 in php_oci_connection_ping is not enough. The server will crash, when
php_oci_connection_status
fail. Because of the twice call of php_oci_connection_close
after the ping-test the server crash. Its enough to call
zend_hash_del(&EG(persistent_list). The destructor of the
persistent_list then call php_oci_connection_close.
Here is my patch (work on php5.2-200606271430)
--- php-5.1.4/ext/oci8/oci8.c.ori 2006-06-26 15:59:03.000000000 +0200
+++ php-5.1.4/ext/oci8/oci8.c 2006-06-27 16:02:28.000000000 +0200
@@ -1065,8 +1065,11 @@
}
}
/* server died */
+ connection->is_open=0;
zend_hash_del(&EG(persistent_list),
hashed_details.c,
hashed_details.len+1);
+ /* one call too much
php_oci_connection_close(connection
TSRMLS_CC);
+ */
connection = NULL;
goto open;
}
Previous Comments:
------------------------------------------------------------------------
[2006-06-28 14:03:15] [EMAIL PROTECTED]
Does this patch help you?
http://tony2001.phpclub.net/dev/tmp/bug37931.diff
------------------------------------------------------------------------
[2006-06-28 10:54:30] Olaf dot Imig at bifab dot de
Here my procedure. I work on a Linux(x86) system. Webserver and
Database are on different computers (communication over TCP!). First I
start the webserver with httpd -X. Then I run my script. netstat show
the connection:
tcp 20 0 medea-dev.l.bifab:59019 ramin.l.bifab.de:1521
ESTABLISHED
Then I stop the database:
lsnrctl stop listener
dbshut (with shutdown immediate)
Then I start the database:
dbstart
lsnrctl start listener
After a short time (2-3 min) I call the my script once more.
=>Segmentation fault
------------------------------------------------------------------------
[2006-06-28 09:32:43] [EMAIL PROTECTED]
I don't know how did you manage to shutdown Oracle instance when there
are active connections and I definitely cannot reproduce it.
Please provide more information.
------------------------------------------------------------------------
[2006-06-28 08:56:51] Olaf dot Imig at bifab dot de
Here my backtrace. When I start with httpd -X the server crash
immediately after database restart
#0 0xa70c228c in kputac () from
/opt/oracle/oracle8i/lib/libclntsh.so.8.0
#1 0xa710ccb1 in OCISessionEnd ()
from /opt/oracle/oracle8i/lib/libclntsh.so.8.0
#2 0xa79cbf43 in php_oci_connection_close (connection=0x824b368)
at
/export/home/users/minstall/medea/software/php5.2-200606271430/ext/oci8/oci8.c:1457
#3 0xa79c99ba in php_oci_pconnection_list_dtor (entry=0x826b4d8)
at
/export/home/users/minstall/medea/software/php5.2-200606271430/ext/oci8/oci8.c:707
#4 0xa7b23bd9 in plist_entry_destructor (ptr=0x826b4d8)
at
/export/home/users/minstall/medea/software/php5.2-200606271430/Zend/zend_list.c:210
#5 0xa7b21590 in zend_hash_del_key_or_index (ht=0xa7c64bd4,
arKey=0x823a5b4 "oci8___opasuser__topasl__0", nKeyLength=27,
h=513927878,
flag=0)
at
/export/home/users/minstall/medea/software/php5.2-200606271430/Zend/zend_hash.c:492
#6 0xa79cad30 in php_oci_do_connect_ex (username=0x823edb4 "OPASUSER",
username_len=8, password=0x823a634 "OPASPASS", password_len=8,
new_password=0x0, new_password_len=0, dbname=0x823d18c "TOPASL",
dbname_len=6, charset=0x0, session_mode=0, persistent=1,
exclusive=0)
at
/export/home/users/minstall/medea/software/php5.2-200606271430/ext/oci8/oci8.c:1077
#7 0xa79ca187 in php_oci_do_connect (ht=3, return_value=0x823a6b4,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1,
persistent=1,
exclusive=0)
at
/export/home/users/minstall/medea/software/php5.2-200606271430/ext/oci8/oci8.c:947
#8 0xa79d9cc7 in zif_oci_pconnect (ht=3, return_value=0x823a6b4,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1)
at
/export/home/users/minstall/medea/software/php5.2-200606271430/ext/oci8/oci8_interface.c:1536
#9 0xa7b3844c in zend_do_fcall_common_helper_SPEC
(execute_data=0xafb2e6f0)
at zend_vm_execute.h:200
#10 0xa7b3b7ec in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xafb2e6f0)
at zend_vm_execute.h:1642
#11 0xa7b38003 in execute (op_array=0x823ecf4) at zend_vm_execute.h:92
#12 0xa7b16625 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
at
/export/home/users/minstall/medea/software/php5.2-200606271430/Zend/zend.c:1110
#13 0xa7acb122 in php_execute_script (primary_file=0xafb30a80)
at
/export/home/users/minstall/medea/software/php5.2-200606271430/main/main.c:1748
#14 0xa7b85710 in php_handler (r=0x8277d98)
at
/export/home/users/minstall/medea/software/php5.2-200606271430/sapi/apache2handler/sapi_apache2.c:593
#15 0x08067ce9 in ap_invoke_handler ()
#16 0x080656b0 in ap_process_request ()
#17 0x08060bcb in ap_process_http_connection ()
#18 0x08070cca in ap_process_connection ()
#19 0x08066b13 in child_main ()
#20 0x08066bfc in make_child ()
#21 0x08066ffe in ap_mpm_run ()
#22 0x0806cfad in main ()
------------------------------------------------------------------------
[2006-06-27 16:57:27] [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.
Also, I should note that ocilogoff($db) does not do anything with
persistent connections, it just ignores them, so this piece of code
doesn't make much sense.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/37931
--
Edit this bug report at http://bugs.php.net/?id=37931&edit=1