|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-09-18 15:51 UTC] amith at xalan dot com
I am running IMP, a web-mail system put out by the Horde group (http://www.horde.org). Ocassionaly, I am experiencing segfaults on some of the child processes. For example in my error_log i get the following print outs. [notice] child pid 2057 exit signal Segmentation fault (11) In IE I typically see Page Cannot Be Displayed Error. If I refresh the browser everything continues to work correctly for a while. This seg fault happens after viewing 10-20 e-mails in a row and can be reliably reproduced (However, its not one particular e-mail that is causing it to crash) I don't see the Page Cannot Be Displayed error in Mozilla, but I think the server is still ocassionally seg faulting, just that Mozilla is doing a better job of handling the error and resubmitting the data to the server. Here is a list of the things relating to PHP that I am running on the server: RedHat 7.3 PHP 4.2.3 Apache 1.3.26 Mod_SSL-2.8.10-1.3.26 openssl-0.9.6g mm-1.2.1 All of these programs were compiled from source on this machine. I tried configuring php with --enable-debug, but after I did that the seg faults stopped and I receive the following message in the logs: Last leak repeated 14 times zend_language_scanner.c(4371) : Freeing 0x083E7C6C (8 bytes), script=/usr/local/apache/htdocs/horde/imp/compose.php Last leak repeated 14 times zend_language_scanner.c(4371) : Freeing 0x08379A8C (8 bytes), script=/usr/local/apache/htdocs/horde/imp/mailbox.php Last leak repeated 14 times ... ... <lots more of these> I configured PHP with the following options: ./configure --with-apxs=/usr/local/apache/bin/apxs --enable-track-vars --with-openssl --with-zlib --with-bz2 --with-pspell --with-db3=/usr/lib --enable-ftp --with-gd --with-imap=/usr/local/imap-2001a --with-imap-ssl=/usr/local/imap-2001a --with-ldap --with-jpeg-dir=/usr/lib --with-xpm-dir=/usr/lib --with-png-dir=/usr/lib --with-freetype-dir=/usr/lib --enable-sigchild --with-gettext --with-mcrypt --with-xml --with-mysql=/usr/local/mysql --enable-cli --with-dom --with-dom-xslt --with-dom-exslt --with-mhash In order to narrow down the problem further I followed the instructions about obtaining a backtrace. What I did was run the following commands 1) gdb /usr/local/apache/bin/httpd a) run -X -DSSL -f /usr/local/apache/conf/httpd.conf b) <proceeded to view some e-mails under IE> c) <obtained backtrace> Here is the output from the backtrace: Program received signal SIGSEGV, Segmentation fault. 0x4207fa78 in strcmp () from /lib/i686/libc.so.6 (gdb) bt #0 0x4207fa78 in strcmp () from /lib/i686/libc.so.6 #1 0x4034a440 in pcre_get_compiled_regex (regex=0x818d7c4 "|MSIE ([0-9.]+)|", extra=0xbfff44c4, preg_options=0xbfff44c8) at php_pcre.c:154 #2 0x4034ab7c in php_pcre_match (ht=3, return_value=0x821a66c, this_ptr=0x0, return_value_used=1, global=0) at php_pcre.c:386 #3 0x4034aedd in zif_preg_match (ht=3, return_value=0x821a66c, this_ptr=0x0, return_value_used=1) at php_pcre.c:523 #4 0x402ea409 in execute (op_array=0x8441734) at ./zend_execute.c:1598 #5 0x402ea5ff in execute (op_array=0x8252e54) at ./zend_execute.c:1638 #6 0x402ea5ff in execute (op_array=0x82ab93c) at ./zend_execute.c:1638 #7 0x402ec366 in execute (op_array=0x83b706c) at ./zend_execute.c:2141 #8 0x402f7db4 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:812 #9 0x40304f91 in php_execute_script (primary_file=0xbffff6f0) at main.c:1383 #10 0x40300dd2 in apache_php_module_main (r=0x815d970, display_source_mode=0) at sapi_apache.c:90 #11 0x403018ae in send_php (r=0x815d970, display_source_mode=0, filename=0x0) at mod_php4.c:575 #12 0x40301902 in send_parsed_php (r=0x815d970) at mod_php4.c:590 #13 0x0806bdcf in ap_invoke_handler () #14 0x08080e53 in process_request_internal () #15 0x08080eb4 in ap_process_request () #16 0x08077df1 in child_main () ---Type <return> to continue, or q <return> to quit--- #17 0x08077fc0 in make_child () #18 0x08078134 in startup_children () #19 0x080787ac in standalone_main () #20 0x0807902b in main () #21 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6 (gdb) frame 4 #4 0x402ea409 in execute (op_array=0x8441734) at ./zend_execute.c:1598 1598 ((zend_internal_function *) EX(function_state).function)->handler(EX(opline)->extended_value, EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(object).ptr, return_value_used TSRMLS_CC); Any help would be appreciated in figuring out what is going wrong here. I can provide any other information if needed. Thanks PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 03:00:01 2025 UTC |
Still getting the segfault at almost the same place. Seems a lot easier to reproduce now. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (LWP 8821)] 0x4207fb88 in strcmp () from /lib/i686/libc.so.6 (gdb) bt #0 0x4207fb88 in strcmp () from /lib/i686/libc.so.6 #1 0x40304db2 in pcre_get_compiled_regex ( regex=0x819925c "|Internet Explorer/([0-9.]+)|", extra=0xbfff8ebc, preg_options=0xbfff8eb4) at /tmp/php4-200210060000/ext/pcre/php_pcre.c:158 #2 0x40305827 in php_pcre_match (ht=3, return_value=0x81353cc, this_ptr=0x0, return_value_used=1, global=0) at /tmp/php4-200210060000/ext/pcre/php_pcre.c:408 #3 0x40305e74 in zif_preg_match (ht=3, return_value=0x81353cc, this_ptr=0x0, return_value_used=1) at /tmp/php4-200210060000/ext/pcre/php_pcre.c:559 #4 0x403eafa3 in execute (op_array=0x81e5dfc) at /tmp/php4-200210060000/Zend/zend_execute.c:1597 #5 0x403eb1d6 in execute (op_array=0x8198e24) at /tmp/php4-200210060000/Zend/zend_execute.c:1641 #6 0x403eb1d6 in execute (op_array=0x8223314) at /tmp/php4-200210060000/Zend/zend_execute.c:1641 #7 0x403ed202 in execute (op_array=0x817d5e4) at /tmp/php4-200210060000/Zend/zend_execute.c:2163 #8 0x403d9128 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /tmp/php4-200210060000/Zend/zend.c:834 #9 0x403a2b92 in php_execute_script (primary_file=0xbffff6f0) at /tmp/php4-200210060000/main/main.c:1542 #10 0x403eff12 in apache_php_module_main (r=0x808cf18, display_source_mode=0) at /tmp/php4-200210060000/sapi/apache/sapi_apache.c:55 #11 0x403f0e0c in send_php (r=0x808cf18, display_source_mode=0, filename=0x808ec10 "/var/www/modesmail/horde/imp/redirect.php") at /tmp/php4-200210060000/sapi/apache/mod_php4.c:564 #12 0x403f0e79 in send_parsed_php (r=0x808cf18) ---Type <return> to continue, or q <return> to quit--- at /tmp/php4-200210060000/sapi/apache/mod_php4.c:579 #13 0x0805475d in ap_invoke_handler () #14 0x080672dc in process_request_internal () #15 0x08067353 in ap_process_request () #16 0x0805f587 in child_main () #17 0x0805f72a in make_child () #18 0x0805f86d in startup_children () #19 0x0805fec0 in standalone_main () #20 0x080607c3 in main () #21 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6(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>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.6I 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.6Please 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