tony2001 Tue Jan 17 23:44:51 2006 UTC
Modified files: (Branch: PHP_5_1)
/php-src NEWS
/php-src/ext/oci8 oci8.c
Log:
MFH: fix #36055 (possible OCI8 crash in multithreaded environment)
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.364&r2=1.2027.2.365&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.364 php-src/NEWS:1.2027.2.365
--- php-src/NEWS:1.2027.2.364 Tue Jan 17 19:57:01 2006
+++ php-src/NEWS Tue Jan 17 23:44:51 2006
@@ -7,6 +7,7 @@
MYSQLI_TYPE_NEWDECIMAL and MYSQLI_TYPE_BIT. FR #36007. (Georg)
- Fixed imagecolorallocate() and imagecolorallocatelapha() to return FALSE
on error. (Pierre)
+- Fixed bug #36055 (possible OCI8 crash in multithreaded environment). (Tony)
- Fixed bug #36046 (parse_ini_file() miscounts lines in multi-line values).
(Ilia)
- Fixed bug #36038 (ext/hash compile failure on Mac OSX). (Tony)
http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?r1=1.269.2.8&r2=1.269.2.9&diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.269.2.8 php-src/ext/oci8/oci8.c:1.269.2.9
--- php-src/ext/oci8/oci8.c:1.269.2.8 Tue Jan 10 08:34:28 2006
+++ php-src/ext/oci8/oci8.c Tue Jan 17 23:44:51 2006
@@ -26,7 +26,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8.c,v 1.269.2.8 2006/01/10 08:34:28 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.269.2.9 2006/01/17 23:44:51 tony2001 Exp $ */
/* TODO
*
* file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty()
with OCI_ATTR_LOBEMPTY
@@ -89,6 +89,7 @@
static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC);
#ifdef ZTS
+static int php_oci_statement_helper(zend_rsrc_list_entry *le TSRMLS_DC);
static int php_oci_regular_helper(zend_rsrc_list_entry *le TSRMLS_DC);
#endif
static int php_oci_connection_ping(php_oci_connection * TSRMLS_DC);
@@ -622,6 +623,10 @@
PHP_RSHUTDOWN_FUNCTION(oci)
{
+#ifdef ZTS
+ zend_hash_apply(&EG(regular_list), (apply_func_t)
php_oci_statement_helper TSRMLS_CC);
+#endif
+
/* check persistent connections and do the necessary actions if needed
*/
zend_hash_apply(&EG(persistent_list), (apply_func_t)
php_oci_persistent_helper TSRMLS_CC);
@@ -639,7 +644,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.8 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.9 $");
sprintf(buf, "%ld", OCI_G(num_persistent));
php_info_print_table_row(2, "Active Persistent Connections", buf);
@@ -1745,6 +1750,21 @@
}
return 0;
} /* }}} */
+
+/* {{{ php_oci_statement_helper()
+ Helper function to destroy statements on thread shutdown in ZTS mode */
+static int php_oci_statement_helper(zend_rsrc_list_entry *le TSRMLS_DC)
+{
+ php_oci_statement *statement;
+
+ if (le->type == le_statement) {
+ statement = (php_oci_statement *)le->ptr;
+ if (statement) {
+ return 1;
+ }
+ }
+ return 0;
+} /* }}} */
#endif
#endif /* HAVE_OCI8 */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php