#37931 [Opn->Fbk]: PHP in Apache crash after Database-Restart while using persistent connections
| From: | tony2001@php.net | Date: | Tue, 27 Jun 2006 15:48:44 +0000 |
| Subject: | #37931 [Opn->Fbk]: PHP in Apache crash after Database-Restart while using persistent connections | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98839@lists.php.net to get a copy of this message | ||
ID: 37931
Updated by: tony2001@php.net
Reported By: Olaf dot Imig at bifab dot de
-Status: Open
+Status: Feedback
Bug Type: OCI8 related
Operating System: Linux(x86)/Solaris(sparc)
PHP Version: 5.1.4
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2006-06-27 15:34:47] Olaf dot Imig at bifab dot de
Description:
------------
The following behavior ist reproduceable:
-Call the script
-shutdown/startup the Database
-Call the script
=> Apache Instance crash
The bug is forced, when you call the script many times. For the tests I
used the OCI8 stuff from Oracle8i on Solaris and from Oracle8i and
Oracle10g on Linux. The result was the same. Without persistent
connection all is perfect.
Perhaps I can deliver a Solution. I made two changes in the code and
the bug vanished.
After restart of Database php_oci_connection_ping found invalid
connections.
The first problem was here, that the function php_oci_connection_close
was called twice, first time triggered through
zend_hash_del(&EG(persistent_list)...
and then through a direct call. The Oracle-C-functions don't like this.
Furthermore some pointers was freed twice.
The second problem is the call of OCISessionEnd, when the Connection is
invalid. Setting of connection->is_close=0 before calling
php_oci_connection_close was helpful in this special case.
On demand I can send my patch.
Reproduce code:
---------------
$db=ociplogon("OPASUSER","OPASPASS","TOPASL");
if(!$db){
print "Connection failed\n";
exit;
}
ocilogoff($db);
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37931&edit=1