I suppose we can omit the ucol_close() call since we're shutting down completely and ICU will close all resources anyway on exit, I believe.

-Andrei

On Oct 4, 2006, at 6:28 AM, Rob Richards wrote:

Seems to be a windows only problem for me. Works fine under linux, but I've tried 3 different builds of the ICU library - even built one from source - and it always crashes at the same point within the ucol_close call.

Rob

Andrei Zmievski wrote:
Strange. I don't see it here on FreeBSD. Does anyone else have this problem?

-A

On Oct 3, 2006, at 4:56 AM, Rob Richards wrote:

I get consistent crashes on windows during shutdown with this change.

Access violation in the dtor at:
ucol_close(unicode_globals->root_collator);

It did open correctly as:
unicode_globals->root_collator = ucol_open("en_US", &status);
returned -128, which is supposedly successful.

I already tried upgrading ICU to 3.4.1 but still same problem.

Rob

Andrei Zmievski wrote:
andrei        Fri Sep 29 20:59:26 2006 UTC

Modified files: /ZendEngine2 zend.c zend_globals.h zend_unicode.c Log:
  Fix off-by-one error.
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.c? r1=1.372&r2=1.373&diff_format=u
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.372 ZendEngine2/zend.c:1.373
--- ZendEngine2/zend.c:1.372    Tue Sep 19 20:44:37 2006
+++ ZendEngine2/zend.c    Fri Sep 29 20:59:26 2006
@@ -17,7 +17,7 @@
+------------------------------------------------------------------- ---+
 */
 -/* $Id: zend.c,v 1.372 2006/09/19 20:44:37 andrei Exp $ */
+/* $Id: zend.c,v 1.373 2006/09/29 20:59:26 andrei Exp $ */
  #include "zend.h"
 #include "zend_extensions.h"
@@ -929,11 +929,26 @@
     unicode_globals->to_error_mode = ZEND_CONV_ERROR_STOP;
     unicode_globals->conv_error_handler = NULL;
 +    {
+        UErrorCode status = U_ZERO_ERROR;
+
+ unicode_globals->root_collator = ucol_open("en_US", &status); + ucol_setStrength(unicode_globals->root_collator, UCOL_PRIMARY); + unicode_globals->root_search = usearch_openFromCollator(EMPTY_STR, 1, EMPTY_STR, 1, + unicode_globals->root_collator, NULL, &status);
+    }
+
zend_hash_init_ex(&unicode_globals->flex_compatible, 0, NULL, NULL, 1, 0);
 }
static void unicode_globals_dtor(zend_unicode_globals *unicode_globals TSRMLS_DC)
 {
+    if (unicode_globals->root_collator) {
+        ucol_close(unicode_globals->root_collator);
+    }
+    if (unicode_globals->root_search) {
+        usearch_close(unicode_globals->root_search);
+    }
     if (unicode_globals->fallback_encoding_conv) {
         ucnv_close(unicode_globals->fallback_encoding_conv);



--PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to