wharmby Mon Mar 5 12:56:26 2007 UTC Modified files: /php-src/ext/com_dotnet com_wrapper.c com_extension.c php_com_dotnet.h /php-src NEWS Log: Fixed bug #35872 (Prevent object store references during RSHUTDOWN) http://cvs.php.net/viewvc.cgi/php-src/ext/com_dotnet/com_wrapper.c?r1=1.14&r2=1.15&diff_format=u Index: php-src/ext/com_dotnet/com_wrapper.c diff -u php-src/ext/com_dotnet/com_wrapper.c:1.14 php-src/ext/com_dotnet/com_wrapper.c:1.15 --- php-src/ext/com_dotnet/com_wrapper.c:1.14 Sat Feb 24 16:25:53 2007 +++ php-src/ext/com_dotnet/com_wrapper.c Mon Mar 5 12:56:26 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: com_wrapper.c,v 1.14 2007/02/24 16:25:53 helly Exp $ */ +/* $Id: com_wrapper.c,v 1.15 2007/03/05 12:56:26 wharmby Exp $ */ /* This module exports a PHP object as a COM object by wrapping it * using IDispatchEx */ @@ -92,13 +92,17 @@ # define TSRMLS_FIXED() #endif -#define FETCH_DISP(methname) \ - TSRMLS_FIXED() \ - php_dispatchex *disp = (php_dispatchex*)This; \ - trace(" PHP:%s %s\n", Z_OBJCE_P(disp->object)->name, methname); \ - if (GetCurrentThreadId() != disp->engine_thread) \ - return RPC_E_WRONG_THREAD; - +#define FETCH_DISP(methname) \ + TSRMLS_FIXED() \ + php_dispatchex *disp = (php_dispatchex*)This; \ + if (COMG(rshutdown_started)) { \ + trace(" PHP Object:%p (name:unknown) %s\n", disp->object, methname); \ + } else { \ + trace(" PHP Object:%p (name:%s) %s\n", disp->object, Z_OBJCE_P(disp->object)->name, methname); \ + } \ + if (GetCurrentThreadId() != disp->engine_thread) { \ + return RPC_E_WRONG_THREAD; \ + } static HRESULT STDMETHODCALLTYPE disp_queryinterface( IDispatchEx *This, @@ -534,7 +538,7 @@ { php_dispatchex *disp = (php_dispatchex*)CoTaskMemAlloc(sizeof(php_dispatchex)); - trace("constructing a COM proxy\n"); + trace("constructing a COM wrapper for PHP object %p (%s)\n", object, Z_OBJCE_P(object)->name); if (disp == NULL) return NULL; @@ -559,8 +563,13 @@ { TSRMLS_FETCH(); - trace("destroying COM wrapper for PHP object %s\n", Z_OBJCE_P(disp->object)->name); - + /* Object store not available during request shutdown */ + if (COMG(rshutdown_started)) { + trace("destroying COM wrapper for PHP object %p (name:unknown)\n", disp->object); + } else { + trace("destroying COM wrapper for PHP object %p (name:%s)\n", disp->object, Z_OBJCE_P(disp->object)->name); + } + disp->id = 0; if (disp->refcount > 0) http://cvs.php.net/viewvc.cgi/php-src/ext/com_dotnet/com_extension.c?r1=1.24&r2=1.25&diff_format=u Index: php-src/ext/com_dotnet/com_extension.c diff -u php-src/ext/com_dotnet/com_extension.c:1.24 php-src/ext/com_dotnet/com_extension.c:1.25 --- php-src/ext/com_dotnet/com_extension.c:1.24 Mon Jan 1 09:29:21 2007 +++ php-src/ext/com_dotnet/com_extension.c Mon Mar 5 12:56:26 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: com_extension.c,v 1.24 2007/01/01 09:29:21 sebastian Exp $ */ +/* $Id: com_extension.c,v 1.25 2007/03/05 12:56:26 wharmby Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -315,6 +315,7 @@ */ PHP_RINIT_FUNCTION(com_dotnet) { + COMG(rshutdown_started) = 0; return SUCCESS; } /* }}} */ @@ -328,6 +329,7 @@ php_com_dotnet_rshutdown(TSRMLS_C); } #endif + COMG(rshutdown_started) = 1; return SUCCESS; } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/com_dotnet/php_com_dotnet.h?r1=1.7&r2=1.8&diff_format=u Index: php-src/ext/com_dotnet/php_com_dotnet.h diff -u php-src/ext/com_dotnet/php_com_dotnet.h:1.7 php-src/ext/com_dotnet/php_com_dotnet.h:1.8 --- php-src/ext/com_dotnet/php_com_dotnet.h:1.7 Mon Jan 1 09:29:22 2007 +++ php-src/ext/com_dotnet/php_com_dotnet.h Mon Mar 5 12:56:26 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_com_dotnet.h,v 1.7 2007/01/01 09:29:22 sebastian Exp $ */ +/* $Id: php_com_dotnet.h,v 1.8 2007/03/05 12:56:26 wharmby Exp $ */ #ifndef PHP_COM_DOTNET_H #define PHP_COM_DOTNET_H @@ -47,6 +47,7 @@ zend_bool autoreg_case_sensitive; void *dotnet_runtime_stuff; /* opaque to avoid cluttering up other modules */ int code_page; /* default code_page if left unspecified */ + zend_bool rshutdown_started; ZEND_END_MODULE_GLOBALS(com_dotnet) #ifdef ZTS http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2140&r2=1.2141&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2140 php-src/NEWS:1.2141 --- php-src/NEWS:1.2140 Fri Feb 16 19:36:45 2007 +++ php-src/NEWS Mon Mar 5 12:56:26 2007 @@ -58,5 +58,6 @@ - Added shm_has_var() function. (Mike) - Added str_getcsv() function. (Sara) - Added ext/hash support to ext/session's ID generator. (Sara) +- Fixed bug #35872 (Prevent object store references during RSHUTDOWN) (Andy)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php