php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8334 Segmentation faults on page load
Submitted: 2000-12-20 09:12 UTC Modified: 2001-03-30 23:37 UTC
From: augustz at bigfoot dot com Assigned:
Status: Closed Package: Output Control
PHP Version: 4.0.4 OS: RedHat Linux 6.1 / 2.2.13-0.13sm
Private report: No CVE-ID: None
 [2000-12-20 09:12 UTC] augustz at bigfoot dot com
Upgrading to 4.0.4 on a machine currently running 4.0.3pl1 seems to generate a seg fault in the apache logs on every page load. Copying the old 4.0.3pl1 libphp4.so back and huping Apache seems to solve the problem. No changes where made to the machine and the compile and ./configure options where identical and are included below between both versions. The opimizer was disabled in php.ini for both cases. 

./configure --with-apxs --with-zlib=/root/distro/zlib-1.1.3 --with-imap  --with-mcrypt=/root/distro/libmcrypt-2.4.5 --without-xml --disable-xml --without-gdb --disable-rpath --with-mysql --disable-debug --with-config-file-path=/home/httpd/conf

[Wed Dec 20 09:02:18 2000] [notice] Apache/1.3.12 (Unix)  (Red Hat/Linux) PHP/4.0.4 configured -- resuming normal operations
[Wed Dec 20 09:02:34 2000] [notice] child pid 2006 exit signal Segmentation fault (11)
[Wed Dec 20 09:02:36 2000] [notice] child pid 2007 exit signal Segmentation fault (11)
[Wed Dec 20 09:02:37 2000] [notice] child pid 2071 exit signal Segmentation fault (11)
[Wed Dec 20 09:02:40 2000] [notice] child pid 2009 exit signal Segmentation fault (11)
[Wed Dec 20 09:02:43 2000] [notice] child pid 2074 exit signal Segmentation fault (11)
[Wed Dec 20 09:02:43 2000] [notice] child pid 2019 exit signal Segmentation fault (11)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-20 09:26 UTC] augustz at bigfoot dot com
Not sure if this is usefull... changed compile to --with-debug and did not strip the debug symbols from the final lib, but I don't think it made much difference on the backtrace. 

[Wed Dec 20 09:24:27 2000] [warn] Loaded DSO modules/libphp4.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)
Error while mapping shared library sections:
h$: No such file or directory.
Error while reading shared library symbols:
h$: No such file or directory.
warning: find_solib: Can't read pathname for load map: Input/output error

Cannot access memory at address 0x706.
(gdb) bt
#0  0x4000adc0 in _dl_debug_state () at dl-debug.c:47
#1  0x4000aadb in _dl_catch_error () at dl-error.c:99
#2  0x40180345 in _dl_open () at dl-open.c:283
#3  0x4009e3d3 in dlopen_doit (a=0xbfffdeb4) at dlopen.c:41
#4  0x4000aadb in _dl_catch_error () at dl-error.c:99
#5  0x4009e8b9 in _dlerror_run (operate=0x4009e3a8 <dlopen_doit>, args=0xbfffdeb4) at dlerror.c:125
#6  0x4009e393 in __dlopen_check (file=0x8109688 "/usr/local/lib/libmcrypt/safer-sk64.so", mode=257) at dlopen.c:53
#7  0x40442f31 in ?? () from /usr/lib/libltdl.so.0
#8  0x4044344d in ?? () from /usr/lib/libltdl.so.0
#9  0x40443840 in ?? () from /usr/lib/libltdl.so.0
#10 0x4044427a in ?? () from /usr/lib/libltdl.so.0
#11 0x404443dc in ?? () from /usr/lib/libltdl.so.0
#12 0x403ea283 in mcrypt_module_get_algo_supported_key_sizes () from /usr/lib/libltdl.so.0
#13 0x403e9c16 in ?? () from /usr/local/lib/libmcrypt.so.4
#14 0x403e98fe in ?? () from /usr/local/lib/libmcrypt.so.4
#15 0x4029787d in php_info_mcrypt (zend_module=0x80b6980) at mcrypt.c:351
#16 0x402da938 in _display_module_info (module=0x80b6980, arg=0xbfffe93c) at info.c:50
#17 0x4027181a in zend_hash_apply_with_argument (ht=0x403cc900, apply_func=0x402da900 <_display_module_info>, argument=0xbfffe93c)
    at zend_hash.c:711
#18 0x402daf8a in php_print_info (flag=-1) at info.c:256
#19 0x402db6fd in php_if_phpinfo (ht=0, return_value=0x8106fec, this_ptr=0x0, return_value_used=0) at info.c:464
#20 0x402602b6 in execute (op_array=0x8106f84) at ./zend_execute.c:1519
#21 0x4026e2d0 in zend_execute_scripts (type=8, file_count=3) at zend.c:729
#22 0x4027f391 in php_execute_script (primary_file=0xbffffb34) at main.c:1221
#23 0x4027be32 in apache_php_module_main (r=0x80e4a14, display_source_mode=0) at sapi_apache.c:89
#24 0x4027c6fb in send_php (r=0x80e4a14, display_source_mode=0, filename=0x0) at mod_php4.c:506
#25 0x4027c72c in send_parsed_php (r=0x80e4a14) at mod_php4.c:517
#26 0x805345e in ap_invoke_handler ()
#27 0x80618fb in ap_some_auth_required ()
#28 0x8061958 in ap_process_request ()
#29 0x805b940 in ap_child_terminate ()
#30 0x805baa7 in ap_child_terminate ()
#31 0x805bba8 in ap_child_terminate ()
#32 0x805c058 in ap_child_terminate ()
#33 0x805c65f in main ()
#34 0x400b99ab in __libc_start_main () at ../sysdeps/generic/libc-start.c:122
 [2000-12-20 10:51 UTC] augustz at bigfoot dot com
Went ahead and compiled without the mcrypt extension Jani's suggestions and partly because I see it just before the error catching on the backtrace and also on. We get a cleaner backtrace on load, and I still see the same problem.

Starting program: /usr/sbin/httpd -X
[Wed Dec 20 10:49:26 2000] [warn] Loaded DSO modules/libphp4.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)

Program received signal SIGSEGV, Segmentation fault.
0x4026a606 in call_user_function_ex () from /etc/httpd/modules/libphp4.so
(gdb) bt
#0  0x4026a606 in call_user_function_ex () from /etc/httpd/modules/libphp4.so
#1  0x40327e49 in php_end_ob_buffer () from /etc/httpd/modules/libphp4.so
#2  0x403280ec in php_end_ob_buffers () from /etc/httpd/modules/libphp4.so
#3  0x40289238 in apache_php_module_main () from /etc/httpd/modules/libphp4.so
#4  0x40289de5 in send_php () from /etc/httpd/modules/libphp4.so
#5  0x40289e25 in send_parsed_php () from /etc/httpd/modules/libphp4.so
#6  0x805345e in ap_invoke_handler ()
#7  0x80618fb in ap_some_auth_required ()
#8  0x8061958 in ap_process_request ()
#9  0x805b940 in ap_child_terminate ()
#10 0x805baa7 in ap_child_terminate ()
#11 0x805bba8 in ap_child_terminate ()
#12 0x805c058 in ap_child_terminate ()
#13 0x805c65f in main ()
#14 0x400b99ab in __libc_start_main () at ../sysdeps/generic/libc-start.c:122
(gdb) kill
Kill the program being debugged? (y or n) y
(gdb) quit
 [2000-12-20 11:20 UTC] augustz at bigfoot dot com
Compiling without imap, mcrypt and zlib seems to solve the problem. Compiling with zlib alone breaks leads to seg faults.

Zlib is a popular addon, especially if the inbuilt obgzhandler requires it. If this slipped by the QA team I'd be suprised... 

Backtrace with zlib (no imap/mcrypt).
[Wed Dec 20 11:18:30 2000] [warn] Loaded DSO modules/libphp4.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)

Program received signal SIGSEGV, Segmentation fault.
0x4024e4c6 in call_user_function_ex (function_table=0x80bd750, object_pp=0x0, function_name=0x80d33dc, retval_ptr_ptr=0xbffffb0c, 
    param_count=1, params=0xbffffb04, no_separation=1, symbol_table=0x0) at zend_execute_API.c:449
449                     ((zend_internal_function *) function_state.function)->handler(param_count, *retval_ptr_ptr, *object_pp, 1 ELS_CC);
(gdb) bt
#0  0x4024e4c6 in call_user_function_ex (function_table=0x80bd750, object_pp=0x0, function_name=0x80d33dc, 
    retval_ptr_ptr=0xbffffb0c, param_count=1, params=0xbffffb04, no_separation=1, symbol_table=0x0) at zend_execute_API.c:449
#1  0x402fb869 in php_end_ob_buffer (send_buffer=1) at output.c:131
#2  0x402fbb0c in php_end_ob_buffers (send_buffer=1) at output.c:191
#3  0x4026d0f8 in apache_php_module_main (r=0x80e081c, display_source_mode=0) at sapi_apache.c:95
#4  0x4026dca5 in send_php (r=0x80e081c, display_source_mode=0, filename=0x80e224c "/home/httpd/html/phpinfo.php")
    at mod_php4.c:506
#5  0x4026dce5 in send_parsed_php (r=0x80e081c) at mod_php4.c:517
#6  0x805345e in ap_invoke_handler ()
#7  0x80618fb in ap_some_auth_required ()
#8  0x8061958 in ap_process_request ()
#9  0x805b940 in ap_child_terminate ()
#10 0x805baa7 in ap_child_terminate ()
#11 0x805bba8 in ap_child_terminate ()
#12 0x805c058 in ap_child_terminate ()
#13 0x805c65f in main ()
#14 0x400b99ab in __libc_start_main () at ../sysdeps/generic/libc-start.c:122


 [2000-12-20 14:25 UTC] jmoore@php.net
Hi,

Could you please supply your php.ini file. There were some problems with the ob so that section is of special interest.. I thought these issues were resolved.

James

 [2000-12-21 21:36 UTC] augustz at bigfoot dot com
output_buffering        = Off   
output_handler          = ob_gzhandler

I'll send along the entire php.ini via email. Havn't had a chance to try without the ob_gzhandler line, will try that this weekend sometime. 
 [2000-12-22 16:33 UTC] augustz at bigfoot dot com
Without ob_gzhander things work fine with at least zlib compiled in.

 [2000-12-22 20:36 UTC] waldschrott@php.net
confirmed, it crashes too on win32 (already known to crash)
 [2001-02-19 23:41 UTC] andre@php.net
could you please try the latest cvs, several patches have
gone in since bug creation and it works for me on
win32+linux now
 [2001-02-24 22:41 UTC] augustz at bigfoot dot com
I grabbed the 200102211045 snaps and have been playing with them without much success. Everything works fine with 4.0.4pl1 but switching up to this seems to fail in all cases. (with ob_gzhandler and without).

[Sat Feb 24 22:14:26 2001] [notice] Apache/1.3.14 (Unix)  (Red-Hat/Linux) PHP/4.0.5-dev configured -- resuming normal operations
[Sat Feb 24 22:15:56 2001] [notice] child pid 22211 exit signal Segmentation fault (11)
[Sat Feb 24 22:21:26 2001] [notice] child pid 22212 exit signal Segmentation fault (11)

Swapping back down to 4.0.4pl1 without ob_gzhandler still works. 
 [2001-03-30 23:37 UTC] augustz at bigfoot dot com
Latest 4.0.5RC4 fixes this. Closing bug. 
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jan 29 08:01:25 2020 UTC