Bug #18258 Updated: Gettting frequent Seg Faults on PHP scripts

From: Date: Wed, 10 Jul 2002 08:37:52 +0000
Subject: Bug #18258 Updated: Gettting frequent Seg Faults on PHP scripts
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13697@lists.php.net to get a copy of this message
ID: 18258 Updated by: tauren@servlets.net Reported By: tauren@servlets.net Status: Open Bug Type: Reproducible crash Operating System: Red Hat 6.2 PHP Version: 4.2.1 New Comment: (I hope it is OK to post these LONG backtrace messages! If it isn't, please let me know the best way to get this information across...) I've been able to produce some additional backtraces that are different than the one previously posted. Again, these are done only hitting phpinfo.php. I seem to get different results hitting this same document. ============ BACKTRACE #1 =================== For this one I got part of the phpinfo() output, but it ended prematurely while displaying the Mysql directives. I don't think the problem has anything to do with mysql, however: (gdb) run -X -DSSL -f /usr/local/apache/conf/custom/test/httpd.conf Starting program: /usr/local/apache/bin/httpd -X -DSSL -f /usr/local/apache/conf/custom/test/httpd.conf Processing config directory: /usr/local/apache/conf/custom/test/virtual Processing config file: /usr/local/apache/conf/custom/test/virtual/www.sample.com:80 Error while mapping shared library sections: Ü!: No such file or directory. Error while reading shared library symbols: Ü!: No such file or directory. warning: find_solib: Can't read pathname for load map: Input/output error Cannot access memory at address 0x1d06 (gdb) bt #0 0x4000af60 in _dl_debug_state () at md4.c:255 #1 0x4000ac7b in _dl_catch_error () at md4.c:255 #2 0x403abd1d in _dl_open (file=0x858e598 "/usr/local/lib/libmcrypt/xtea.so", mode=257, caller=0xbfffd980) at dl-open.c:232 #3 0x4024d3d3 in dlopen_doit (a=0xbfffda94) at dlopen.c:41 #4 0x4000ac7b in _dl_catch_error () at md4.c:255 #5 0x4024d8b9 in _dlerror_run (operate=0x4024d3a8 <dlopen_doit>, args=0xbfffda94) at dlerror.c:125 #6 0x4024d393 in __dlopen_check (file=0x858e598 "/usr/local/lib/libmcrypt/xtea.so", mode=257) at dlopen.c:53 #7 0x4004ef31 in sys_dl_open (handle=0x858ca18, filename=0x858e598 "/usr/local/lib/libmcrypt/xtea.so") at ltdl.c:266 #8 0x4004f44d in tryall_dlopen (handle=0xbfffdbd4, filename=0x858e598 "/usr/local/lib/libmcrypt/xtea.so") at ltdl.c:943 #9 0x4004f55e in find_module (handle=0xbfffdbd4, dir=0x8591a90 "/usr/local/lib/libmcrypt/", libdir=0x8591ce0 "/usr/local/lib/libmcrypt", dlname=0x8591cc0 "xtea.so", old_name=0x8591cd0 "xtea.a", installed=1) at ltdl.c:986 #10 0x400500f4 in lt_dlopen (filename=0x8591f00 "xtea.la") at ltdl.c:1340 #11 0x400503dc in lt_dlopenext (filename=0x8591f00 "xtea.la") at ltdl.c:1423 #12 0x4004b4d2 in mcrypt_module_close () at mcrypt_modules.c:49 #13 0x4004ad96 in mcrypt_free_p () at mcrypt_extra.c:205 #14 0x4004aaab in mcrypt_list_algorithms (libdir=0x0, size=0xbfffe4a0) at mcrypt_extra.c:106 #15 0x810654b in zm_info_mcrypt (zend_module=0x8570dd8) at mcrypt.c:365 #16 0x8147d65 in _display_module_info (module=0x8570dd8, arg=0xbfffe4f0) at info.c:49 #17 0x81b5f10 in zend_hash_apply_with_argument (ht=0x84249e0, apply_func=0x8147d20 <_display_module_info>, argument=0xbfffe4f0) at zend_hash.c:705 #18 0x8148514 in php_print_info (flag=-1) at info.c:259 #19 0x8148d98 in zif_phpinfo (ht=0, return_value=0x85903ac, this_ptr=0x0, return_value_used=0) at info.c:471 #20 0x81d4d01 in execute (op_array=0x8590324) at ./zend_execute.c:1598 #21 0x81b0bbc in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810 #22 0x80c9c7f in php_execute_script (primary_file=0xbffff830) at main.c:1381 #23 0x81bbde9 in apache_php_module_main (r=0x8526e30, display_source_mode=0) at sapi_apache.c:90 #24 0x80c6316 in send_php () at md4.c:255 #25 0x80c636f in send_parsed_php () at md4.c:255 #26 0x821bd83 in ap_invoke_handler () at md4.c:255 #27 0x8230b59 in process_request_internal () at md4.c:255 #28 0x8230bbc in ap_process_request () at md4.c:255 #29 0x8227c1e in child_main () at md4.c:255 #30 0x8227dd0 in make_child () at md4.c:255 #31 0x8227f29 in startup_children () at md4.c:255 #32 0x8228586 in standalone_main () at md4.c:255 #33 0x8228d63 in main () at md4.c:255 #34 0x402e59cb in __libc_start_main (main=0x82289fc <main>, argc=5, argv=0xbffffb44, init=0x808f990 <_init>, fini=0x832864c <_fini>, rtld_fini=0x4000aea0 <_dl_fini>, stack_end=0xbffffb3c) at ../sysdeps/generic/libc-start.c:92 (gdb) ni Error while reading shared library symbols: Ü!: No such file or directory. Program received signal SIGSEGV, Segmentation fault. 0x4024f078 in last_result () from /lib/libdl.so.2 (gdb) bt #0 0x4024f078 in last_result () from /lib/libdl.so.2 #1 0x8591d58 in ?? () at md4.c:255 #2 0x0 in MD4Transform (buf=Cannot access memory at address 0x13a3c ) (gdb) ni Program terminated with signal SIGSEGV, Segmentation fault. The program no longer exists. ============ BACKTRACE #2 =================== This time I got some output again, up to the MySQL section (it didn't display as much as the first time). Then when gdb reported that the program ended, all the stuff in my browser window disappeared and I got the normal MSIE "Page cannot be displayed" message. (gdb) run -X -DSSL -f /usr/local/apache/conf/custom/test/httpd.conf Starting program: /usr/local/apache/bin/httpd -X -DSSL -f /usr/local/apache/conf/custom/test/httpd.conf Processing config directory: /usr/local/apache/conf/custom/test/virtual Processing config file: /usr/local/apache/conf/custom/test/virtual/www.sample.com:80 Cannot access memory at address 0x6c2f6269 (gdb) bt #0 0x4000af60 in _dl_debug_state () at md4.c:255 #1 0x4000ac7b in _dl_catch_error () at md4.c:255 #2 0x403abd1d in _dl_open (file=0x8591ac8 "/usr/local/lib/libmcrypt/twofish.so", mode=257, caller=0xbfffd980) at dl-open.c:232 #3 0x4024d3d3 in dlopen_doit (a=0xbfffda94) at dlopen.c:41 #4 0x4000ac7b in _dl_catch_error () at md4.c:255 #5 0x4024d8b9 in _dlerror_run (operate=0x4024d3a8 <dlopen_doit>, args=0xbfffda94) at dlerror.c:125 #6 0x4024d393 in __dlopen_check (file=0x8591ac8 "/usr/local/lib/libmcrypt/twofish.so", mode=257) at dlopen.c:53 #7 0x4004ef31 in sys_dl_open (handle=0x858ca58, filename=0x8591ac8 "/usr/local/lib/libmcrypt/twofish.so") at ltdl.c:266 #8 0x4004f44d in tryall_dlopen (handle=0xbfffdbd4, filename=0x8591ac8 "/usr/local/lib/libmcrypt/twofish.so") at ltdl.c:943 #9 0x4004f55e in find_module (handle=0xbfffdbd4, dir=0x85915d0 "/usr/local/lib/libmcrypt/", libdir=0x8591a18 "/usr/local/lib/libmcrypt", dlname=0x85919f8 "twofish.so", old_name=0x8591a08 "twofish.a", installed=1) at ltdl.c:986 #10 0x400500f4 in lt_dlopen (filename=0x85914c0 "twofish.la") at ltdl.c:1340 #11 0x400503dc in lt_dlopenext (filename=0x85914c0 "twofish.la") at ltdl.c:1423 #12 0x4004b4d2 in mcrypt_module_close () at mcrypt_modules.c:49 #13 0x4004ad96 in mcrypt_free_p () at mcrypt_extra.c:205 #14 0x4004aaab in mcrypt_list_algorithms (libdir=0x0, size=0xbfffe4a0) at mcrypt_extra.c:106 #15 0x810654b in zm_info_mcrypt (zend_module=0x8570dd8) at mcrypt.c:365 #16 0x8147d65 in _display_module_info (module=0x8570dd8, arg=0xbfffe4f0) at info.c:49 #17 0x81b5f10 in zend_hash_apply_with_argument (ht=0x84249e0, apply_func=0x8147d20 <_display_module_info>, argument=0xbfffe4f0) at zend_hash.c:705 #18 0x8148514 in php_print_info (flag=-1) at info.c:259 #19 0x8148d98 in zif_phpinfo (ht=0, return_value=0x85902f4, this_ptr=0x0, return_value_used=0) at info.c:471 #20 0x81d4d01 in execute (op_array=0x859026c) at ./zend_execute.c:1598 #21 0x81b0bbc in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810 #22 0x80c9c7f in php_execute_script (primary_file=0xbffff830) at main.c:1381 #23 0x81bbde9 in apache_php_module_main (r=0x8526e30, display_source_mode=0) at sapi_apache.c:90 #24 0x80c6316 in send_php () at md4.c:255 #25 0x80c636f in send_parsed_php () at md4.c:255 #26 0x821bd83 in ap_invoke_handler () at md4.c:255 #27 0x8230b59 in process_request_internal () at md4.c:255 #28 0x8230bbc in ap_process_request () at md4.c:255 #29 0x8227c1e in child_main () at md4.c:255 #30 0x8227dd0 in make_child () at md4.c:255 #31 0x8227f29 in startup_children () at md4.c:255 #32 0x8228586 in standalone_main () at md4.c:255 #33 0x8228d63 in main () at md4.c:255 #34 0x402e59cb in __libc_start_main (main=0x82289fc <main>, argc=5, argv=0xbffffb44, init=0x808f990 <_init>, fini=0x832864c <_fini>, rtld_fini=0x4000aea0 <_dl_fini>, stack_end=0xbffffb3c) at ../sysdeps/generic/libc-start.c:92 (gdb) step dl_open_worker (a=0xbfffd984) at dl-open.c:198 198 dl-open.c: No such file or directory. (gdb) step warning: Cannot insert breakpoint 0: Cannot access memory at address 0x0 (gdb) step Cannot find bounds of current function (gdb) step Cannot find bounds of current function (gdb) step Cannot find bounds of current function (gdb) bt #0 0x402e3d24 in ?? () from /lib/libc.so.6 #1 0x4000ac7b in _dl_catch_error () at md4.c:255 #2 0x403abd1d in _dl_open (file=0x8591ac8 "/usr/local/lib/libmcrypt/twofish.so", mode=257, caller=0xbfffd980) at dl-open.c:232 #3 0x4024d3d3 in dlopen_doit (a=0xbfffda94) at dlopen.c:41 #4 0x4000ac7b in _dl_catch_error () at md4.c:255 #5 0x4024d8b9 in _dlerror_run (operate=0x4024d3a8 <dlopen_doit>, args=0xbfffda94) at dlerror.c:125 #6 0x4024d393 in __dlopen_check (file=0x8591ac8 "/usr/local/lib/libmcrypt/twofish.so", mode=257) at dlopen.c:53 #7 0x4004ef31 in sys_dl_open (handle=0x858ca58, filename=0x8591ac8 "/usr/local/lib/libmcrypt/twofish.so") at ltdl.c:266 #8 0x4004f44d in tryall_dlopen (handle=0xbfffdbd4, filename=0x8591ac8 "/usr/local/lib/libmcrypt/twofish.so") at ltdl.c:943 #9 0x4004f55e in find_module (handle=0xbfffdbd4, dir=0x85915d0 "/usr/local/lib/libmcrypt/", libdir=0x8591a18 "/usr/local/lib/libmcrypt", dlname=0x85919f8 "twofish.so", old_name=0x8591a08 "twofish.a", installed=1) at ltdl.c:986 #10 0x400500f4 in lt_dlopen (filename=0x85914c0 "twofish.la") at ltdl.c:1340 #11 0x400503dc in lt_dlopenext (filename=0x85914c0 "twofish.la") at ltdl.c:1423 #12 0x4004b4d2 in mcrypt_module_close () at mcrypt_modules.c:49 #13 0x4004ad96 in mcrypt_free_p () at mcrypt_extra.c:205 #14 0x4004aaab in mcrypt_list_algorithms (libdir=0x0, size=0xbfffe4a0) at mcrypt_extra.c:106 #15 0x810654b in zm_info_mcrypt (zend_module=0x8570dd8) at mcrypt.c:365 #16 0x8147d65 in _display_module_info (module=0x8570dd8, arg=0xbfffe4f0) at info.c:49 #17 0x81b5f10 in zend_hash_apply_with_argument (ht=0x84249e0, apply_func=0x8147d20 <_display_module_info>, argument=0xbfffe4f0) at zend_hash.c:705 #18 0x8148514 in php_print_info (flag=-1) at info.c:259 #19 0x8148d98 in zif_phpinfo (ht=0, return_value=0x85902f4, this_ptr=0x0, return_value_used=0) at info.c:471 #20 0x81d4d01 in execute (op_array=0x859026c) at ./zend_execute.c:1598 #21 0x81b0bbc in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810 #22 0x80c9c7f in php_execute_script (primary_file=0xbffff830) at main.c:1381 #23 0x81bbde9 in apache_php_module_main (r=0x8526e30, display_source_mode=0) at sapi_apache.c:90 #24 0x80c6316 in send_php () at md4.c:255 #25 0x80c636f in send_parsed_php () at md4.c:255 #26 0x821bd83 in ap_invoke_handler () at md4.c:255 #27 0x8230b59 in process_request_internal () at md4.c:255 #28 0x8230bbc in ap_process_request () at md4.c:255 #29 0x8227c1e in child_main () at md4.c:255 #30 0x8227dd0 in make_child () at md4.c:255 #31 0x8227f29 in startup_children () at md4.c:255 #32 0x8228586 in standalone_main () at md4.c:255 #33 0x8228d63 in main () at md4.c:255 #34 0x402e59cb in __libc_start_main (main=0x82289fc <main>, argc=5, argv=0xbffffb44, init=0x808f990 <_init>, fini=0x832864c <_fini>, rtld_fini=0x4000aea0 <_dl_fini>, stack_end=0xbffffb3c) at ../sysdeps/generic/libc-start.c:92 (gdb) step Cannot find bounds of current function (gdb) next Cannot find bounds of current function (gdb) next Cannot find bounds of current function (gdb) next Cannot find bounds of current function (gdb) next Cannot find bounds of current function (gdb) si 0x4000add0 255 md4.c: No such file or directory. (gdb) ni Program received signal SIGSEGV, Segmentation fault. 0x4024f078 in last_result () from /lib/libdl.so.2 (gdb) next Single stepping until exit from function last_result, which has no line number information. Program terminated with signal SIGSEGV, Segmentation fault. The program no longer exists. ============ BACKTRACE #3 =================== I'm not going to show another backtrace, but this time the output stalled around the MySQL section again. But when it completed finally, the rest of the phpinfo() was displayed on the web page. The only thing missing on the page were the two images at the top. Hopefully this helps! In the meantime, I'll go and look for xtea.so and twofish.so. And I'll try recompiling without libmcrypt installed. Tauren Previous Comments: ------------------------------------------------------------------------ [2002-07-10 03:54:01] tauren@servlets.net I just upgraded to Apache 1.3.26 with PHP 4.2.1 and now I'm having problems with Segmentaion Faults when going to PHP pages. Previous to upgrading, my Apache/PHP server was running with all of the same options that I'm compiling in now. I wasn't having problems with the Apache 1.3.24/PHP4.2.0 combination. For instance, I have a simple document called phpinfo.php that contains the following: <?php phpinfo(); ?> When I hit this page, I will normally get the text output, but sometimes my browser will come back with no data or an error. Most of the time the two images (PHP and Zend) will not display. When this happens, the following errors are appended to the error_log: [Wed Jul 10 00:38:43 2002] [notice] child pid 1295 exit signal Segmentation fault (11) [Wed Jul 10 00:38:46 2002] [notice] child pid 1298 exit signal Segmentation fault (11) I've recompiled Apache and PHP with the --enable-debug option. Here is how PHP is configured: CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure --prefix=/usr/local \ --with-apache=/home/local/src/atb/Apachetoolbox-1.5.58/apache_1.3.26 \ --enable-exif \ --enable-track-vars \ --with-calendar=shared \ --enable-magic-quotes \ --enable-trans-sid \ --enable-wddx \ --enable-ftp \ --enable-inline-optimization \ --enable-memory-limit \ --enable-debug \ --with-gd="/usr/local" \ --with-zlib \ --enable-gd-native-tt \ --with-t1lib="/usr/local" \ --with-jpeg-dir="/usr" \ --with-png-dir="/usr" \ --with-zlib-dir="/usr" \ --with-ttf \ --with-freetype-dir="/usr/local" \ --with-imap=/usr/local \ --with-mhash=/usr/local \ --with-mcrypt=/usr/local \ --with-openssl="/usr/local" \ --with-curl=/usr/local \ --with-gettext="/usr" \ --with-mysql=/usr \ --with-ldap \ Here is how Apache is configured: export SSL_BASE=/usr/local export EAPI_MM=/home/local/src/atb/Apachetoolbox-1.5.58/src/mm-1.1.3 export CFLAGS="" export LIBS="" export INCLUDES="" ./configure --prefix=/usr/local/apache \ --enable-suexec \ --suexec-caller=nobody \ --suexec-docroot=/home \ --suexec-logfile=/var/log/httpd/cgi.log \ --suexec-uidmin=500 \ --suexec-gidmin=500 \ --suexec-safepath=/usr/local/bin:/usr/bin:/bin \ --enable-module=so \ --enable-module=access \ --disable-module=auth_db \ --disable-module=digest \ --enable-module=imap \ --enable-module=mime \ --enable-module=setenvif \ --enable-module=usertrack \ --enable-module=auth \ --disable-module=cern_meta \ --disable-module=expires \ --enable-module=log_config \ --disable-module=proxy \ --disable-module=vhost_alias \ --disable-module=auth_anon \ --enable-module=cgi \ --enable-module=headers \ --disable-module=log_referer \ --enable-module=rewrite \ --enable-module=userdir \ --enable-module=asis \ --enable-module=autoindex \ --disable-module=example \ --disable-module=log_agent \ --enable-module=negotiation \ --enable-module=status \ --enable-module=actions \ --disable-module=auth_dbm \ --enable-module=dir \ --enable-module=include \ --disable-module=mime_magic \ --disable-module=unique_id \ --enable-module=alias \ --disable-module=auth_digest \ --enable-module=env \ --disable-module=info \ --disable-module=mmap_static \ --disable-module=speling \ --enable-module=ssl \ --activate-module=src/modules/layout/liblayout.a \ --activate-module=src/modules/ldap/mod_auth_ldap.c \ --activate-module=src/modules/perl/libperl.a \ --add-module=mod_frontpage.c --activate-module=src/modules/dav/libdav.a \ --add-module=/home/local/src/atb/Apachetoolbox-1.5.58/src/mod_gzip.c \ --activate-module=src/modules/php4/libphp4.a \ Note again that my previous Apache/PHP installation was successfully using all of these options. I'm not that familiar with using gdb, so I'll explain exactly what I did. Using this debug version of Apache/PHP, I executed this command: gdb /usr/local/apache/bin/httpd At the (gdb) prompt, I entered this (my Apache configuration doesn't use the default httpd.conf location): (gdb) run -X -DSSL -f /usr/local/apache/conf/custom/test/httpd.conf Starting program: /usr/local/apache/bin/httpd -X -DSSL -f /usr/local/apache/conf/custom/test/httpd.conf Processing config directory: /usr/local/apache/conf/custom/test/virtual Processing config file: /usr/local/apache/conf/custom/test/virtual/www.sample.com:80 When I hit the phpinfo.php page, this was output in gdb: Program received signal SIGSEGV, Segmentation fault. 0x81b42a6 in _zend_is_inconsistent (ht=0x63616373, file=0x8364c24 "zend_hash.c", line=681) at zend_hash.c:84 84 if (ht->inconsistent==HT_OK) { I did a backtrace and got this: (gdb) bt #0 0x81b42a6 in _zend_is_inconsistent (ht=0x63616373, file=0x8364c24 "zend_hash.c", line=681) at zend_hash.c:84 #1 0x81b5e26 in zend_hash_apply (ht=0x63616373, apply_func=0x80c5f78 <php_apache_alter_ini_entries>) at zend_hash.c:681 #2 0x80c6130 in send_php () at md4.c:255 #3 0x80c636f in send_parsed_php () at md4.c:255 #4 0x821bd83 in ap_invoke_handler () at md4.c:255 #5 0x8230b59 in process_request_internal () at md4.c:255 #6 0x8230bbc in ap_process_request () at md4.c:255 #7 0x8227c1e in child_main () at md4.c:255 #8 0x8227dd0 in make_child () at md4.c:255 #9 0x8227f29 in startup_children () at md4.c:255 #10 0x8228586 in standalone_main () at md4.c:255 #11 0x8228d63 in main () at md4.c:255 #12 0x402e59cb in __libc_start_main (main=0x82289fc <main>, argc=5, argv=0xbffffb44, init=0x808f990 <_init>, fini=0x832864c <_fini>, rtld_fini=0x4000aea0 <_dl_fini>, stack_end=0xbffffb3c) at ../sysdeps/generic/libc-start.c:92 I don't know if this is helpful or not. If you need more details, please let me know what you need and how to get it. This problem seems to be happening only on any PHP page. No other document types are causing the problem. Normally I would also include APC (alternative cache) and/or Zend Optimizer, but I've left them out for now. Currently my PHP customers on this server are without reliable PHP service. Any help or suggestions would be very much appreciated! Thanks, Tauren ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18258&edit=1

« previous php.bugs (#13697) next »