ID:               19482
 User updated by:  [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         PCRE related
 Operating System: Redhat 7.3
 PHP Version:      4.2.3,4.3.0-dev
 New Comment:

I applied the patch to php4-200209191800 (the newest snapshot died with
some other unrelated problem) and ran my normal tests.  Looked like
this fixed it!  I went through 174 emails with IE and had no segfaults.
 Thanks for everyone's help in solving this problem and continue with
the good work.


Previous Comments:
------------------------------------------------------------------------

[2002-10-07 11:16:59] [EMAIL PROTECTED]

Please try this patch and report back:

RCS file: /repository/php4/ext/pcre/php_pcre.c,v
retrieving revision 1.128
diff -u -2 -b -w -B -r1.128 php_pcre.c
--- ext/pcre/php_pcre.c 11 Sep 2002 14:41:25 -0000  1.128
+++ ext/pcre/php_pcre.c 7 Oct 2002 16:05:59 -0000
@@ -67,4 +67,5 @@
 #if HAVE_SETLOCALE
    if ((void*)pce->tables) pefree((void*)pce->tables, 1);
+   pefree(pce->locale, 1);
 #endif
 }
@@ -303,5 +304,5 @@
    new_entry.preg_options = poptions;
 #if HAVE_SETLOCALE
-   new_entry.locale = locale;
+   new_entry.locale = pestrdup(locale, 1);
    new_entry.tables = tables;
 #endif


------------------------------------------------------------------------

[2002-10-06 22:41:36] [EMAIL PROTECTED]

I tried with the newest snapshot but I get the following backtrace

(gdb) run -X -DSSL -f /usr/local/apache/conf/httpd.conf
Starting program: /usr/local/apache/bin/httpd -X -DSSL -f
/usr/local/apache/conf/httpd.conf

Program received signal SIGSEGV, Segmentation fault.
0x403d2e94 in _efree (ptr=0x0)
    at /usr/local/software/php4-200210061800/Zend/zend_alloc.c:211
211             CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
(gdb) bt
#0  0x403d2e94 in _efree (ptr=0x0)
    at /usr/local/software/php4-200210061800/Zend/zend_alloc.c:211
#1  0x403e5b8e in zend_hash_destroy (ht=0x82ea824)
    at /usr/local/software/php4-200210061800/Zend/zend_hash.c:550
#2  0x403e063a in _zval_dtor (zvalue=0x81802ec)
    at /usr/local/software/php4-200210061800/Zend/zend_variables.c:51
#3  0x403f1206 in execute (op_array=0x82d130c)
    at /usr/local/software/php4-200210061800/Zend/zend_execute.c:449
#4  0x403f411a in execute (op_array=0x82182e4)
    at /usr/local/software/php4-200210061800/Zend/zend_execute.c:1641
#5  0x403e1adc in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
    at /usr/local/software/php4-200210061800/Zend/zend.c:834
#6  0x403bbfed in php_execute_script (primary_file=0xbffff6d0)
    at /usr/local/software/php4-200210061800/main/main.c:1542
#7  0x403fb4b6 in apache_php_module_main (r=0x816c9e0,
display_source_mode=0)
    at
/usr/local/software/php4-200210061800/sapi/apache/sapi_apache.c:55
#8  0x403fbfd6 in send_php (r=0x816c9e0, display_source_mode=0,
filename=0x0)
    at
/usr/local/software/php4-200210061800/sapi/apache/mod_php4.c:564
#9  0x403fc02a in send_parsed_php (r=0x816c9e0)
    at
/usr/local/software/php4-200210061800/sapi/apache/mod_php4.c:579
#10 0x0806bdcf in ap_invoke_handler ()
#11 0x08080e53 in process_request_internal ()
#12 0x08080eb4 in ap_process_request ()
---Type <return> to continue, or q <return> to quit---
#13 0x08077df1 in child_main ()
#14 0x08077fc0 in make_child ()
#15 0x08078134 in startup_children ()
#16 0x080787ac in standalone_main ()
#17 0x0807902b in main ()
#18 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6

------------------------------------------------------------------------

[2002-10-06 19:08:49] [EMAIL PROTECTED]

Note sure if this will be useful, but if i edit main/php_config.h
(after running ./configure) and remove all LOCALE defines, here's a
backtrace of the segfault:

------------------

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 6702)]
0x403d6c67 in _zval_dtor (zvalue=0x82ad344,
    __zend_filename=0x40432520
"/tmp/php-debug/Zend/zend_execute_API.c",
    __zend_lineno=291) at /tmp/php-debug/Zend/zend_variables.c:43
43                              CHECK_ZVAL_STRING_REL(zvalue);
(gdb) bt
#0  0x403d6c67 in _zval_dtor (zvalue=0x82ad344,
    __zend_filename=0x40432520
"/tmp/php-debug/Zend/zend_execute_API.c",
    __zend_lineno=291) at /tmp/php-debug/Zend/zend_variables.c:43
#1  0x403cd471 in _zval_ptr_dtor (zval_ptr=0x40463b80,
    __zend_filename=0x40434300
"/tmp/php-debug/Zend/zend_execute_locks.h",
    __zend_lineno=26) at /tmp/php-debug/Zend/zend_execute_API.c:291
#2  0x403ee0b4 in zend_clean_garbage () at
/tmp/php-debug/Zend/zend_execute_locks.h:26
#3  0x403e7bd5 in execute (op_array=0x82ae564) at
/tmp/php-debug/Zend/zend_execute.c:1050
#4  0x403eab86 in execute (op_array=0x81e95c4) at
/tmp/php-debug/Zend/zend_execute.c:1641
#5  0x403eab86 in execute (op_array=0x8241b2c) at
/tmp/php-debug/Zend/zend_execute.c:1641
#6  0x403d8ad8 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
    at /tmp/php-debug/Zend/zend.c:834
#7  0x403a2542 in php_execute_script (primary_file=0xbffff700)
    at /tmp/php-debug/main/main.c:1542
#8  0x403ef8c2 in apache_php_module_main (r=0x808cf18,
display_source_mode=0)
    at /tmp/php-debug/sapi/apache/sapi_apache.c:55
#9  0x403f07bc in send_php (r=0x808cf18, display_source_mode=0,
    filename=0x808ebe0 "/var/www/modesmail/horde/imp/redirect.php")
    at /tmp/php-debug/sapi/apache/mod_php4.c:564
#10 0x403f0829 in send_parsed_php (r=0x808cf18)
    at /tmp/php-debug/sapi/apache/mod_php4.c:579
#11 0x0805475d in ap_invoke_handler ()
#12 0x080672dc in process_request_internal ()
#13 0x08067353 in ap_process_request ()
#14 0x0805f587 in child_main ()
#15 0x0805f72a in make_child ()
---Type <return> to continue, or q <return> to quit---
#16 0x0805f86d in startup_children ()
#17 0x0805fec0 in standalone_main ()
#18 0x080607c3 in main ()
#19 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6

------------------------------------------------------------------------

[2002-10-06 14:47:25] [EMAIL PROTECTED]

(gdb) up
#1  0x40304db2 in pcre_get_compiled_regex (regex=0x8201704 "|MSIE
([0-9.]+)|",
    extra=0xbfff7cac, preg_options=0xbfff7ca4)
    at /tmp/php4-200210060000/ext/pcre/php_pcre.c:158
158                     if (!strcmp(pce->locale, locale)) {
(gdb) print locale
$1 = 0x8156760 "en_US.iso885915"
(gdb) print pce
$2 = (pcre_cache_entry *) 0x8133668
(gdb) print pce->locale
$3 = 0x826bde8 <Address 0x826bde8 out of bounds>

------------------------------------------------------------------------

[2002-10-06 07:44:55] [EMAIL PROTECTED]

[EMAIL PROTECTED] :
Can you try that again, but when you hit the segfault,
type the following commands into gdb:

up
print locale
print pce
print pce->locale


------------------------------------------------------------------------

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/19482

-- 
Edit this bug report at http://bugs.php.net/?id=19482&edit=1

Reply via email to