php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13816 Accessing a static HTML page crashes Apache
Submitted: 2001-10-24 13:17 UTC Modified: 2001-11-20 11:02 UTC
From: lupe at lupe-christoph dot de Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.0.6 OS: Solaris 8 SPARC
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lupe at lupe-christoph dot de
New email:
PHP Version: OS:

 

 [2001-10-24 13:17 UTC] lupe at lupe-christoph dot de
Config: Apache 1.3.22, mod_perl 1.26 with perl 5.6.1,
        PHP 4.0.6, Sun E250, Solaris 8
PHP configured with apxs like this:
./configure --verbose --prefix=/opt/OCTOapache-1.3.22 --datadir=/opt/OCTOapache-1.3.22/lib --exec-prefix=/opt/OCTOapache-1.3.22 --libexecdir=/opt/OCTOapache-1.3.22/helpers --localstatedir=/opt/OCTOapache-1.3.22/lib --enable-sysvsem -enable-sysvshm --with-ndbm --with-yp --with-ldap=/opt/local/sparc --with-mysql=/opt/OCTOmysql --enable-shmop --with-exec-dir=/opt/OCTOapache-1.3.22/safe-exec --with-config-file-path=/opt/OCTOapache-1.3.22/conf/php3.ini --enable-safe-mode --with-apxs=/opt/OCTOapache-1.3.22/bin/apxs


Just doing a HEAD request on / crashes Apache if libphp4.so
is loaded:

LoadModule php4_module        libexec/libphp4.so
AddModule mod_php4.c

telnet localhost 8088
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HEAD / HTTP/1.0

Connection closed by foreign host.

This is the tail of the systemcall trace from truss:
11140:  stat64("/opt/OCTOapache-1.3.22/htdocs/index.html.ru.iso-ru", 0x002E3908)
 = 0
11140:  stat64("/opt/OCTOapache-1.3.22/htdocs/index.html.ru.koi8-r", 0x002E3908)
 = 0
11140:  stat64("/opt/OCTOapache-1.3.22/htdocs/index.html.ru.ucs2", 0x002E3908) =
 0
11140:  stat64("/opt/OCTOapache-1.3.22/htdocs/index.html.ru.ucs4", 0x002E3908) =
 0
11140:  stat64("/opt/OCTOapache-1.3.22/htdocs/index.html.ru.utf8", 0x002E3908) =
 0
11140:  getdents64(7, 0x0028C018, 1048)                 = 128
11140:  stat64("/opt/OCTOapache-1.3.22/htdocs/index.html.se", 0x002E3908) = 0
11140:  stat64("/opt/OCTOapache-1.3.22/htdocs/index.html.zh.Big5", 0x002E7908) =
 0
11140:  getdents64(7, 0x0028C018, 1048)                 = 0
11140:  close(7)                                        = 0
11140:  stat64("/opt/OCTOapache-1.3.22/htdocs/index.html.en", 0x002A7500) = 0
11140:      Incurred fault #6, FLTBOUNDS  %pc = 0xFF05990C
11140:        siginfo: SIGSEGV SEGV_MAPERR addr=0x0000005C
11140:      Received signal #11, SIGSEGV [default]
11140:        siginfo: SIGSEGV SEGV_MAPERR addr=0x0000005C
11140:          *** process killed ***

And this is the stack when the crash happens:
core file = /opt/OCTOapache-1.3.22/core -- program ``httpd'' on platform SUNW,Ultra-250
SIGSEGV: Segmentation Fault
$C
yy_get_next_buffer(0x1aafd8,0x1a2818,0x2,0x0,0x0,0x0) + 21c
        [savfp=0xffbef830,savpc=0x7555c]
ap_clear_pool(0x1a2818,0x1a6818,0x0,0x0,0x0,0x0) + 4c
        [savfp=0xffbef8a0,savpc=0x755ec]
ap_destroy_pool(0x1a2818,0x19e818,0x0,0xff238018,0xffbeda11,0x0) + 14
        [savfp=0xffbef910,savpc=0x75544]
ap_clear_pool(0x19e818,0xff23fa9c,0x0,0xa,0x0,0xffbed9d0) + 34
        [savfp=0xffbef980,savpc=0x755ec]
ap_destroy_pool(0x19e818,0x19a9a0,0xd,0x1a2840,0x0,0x16ca98) + 14
        [savfp=0xffbef9f0,savpc=0x8b0b8]
clean_parent_exit(0x0,0x13d2,0xd,0x1a2840,0x16ca98,0x16c800) + 14
        [savfp=0xffbefa60,savpc=0x8f044]
standalone_main(0x1,0xffbefbfc,0x0,0x0,0xff23b03c,0x16cb58) + 764
        [savfp=0xffbefae8,savpc=0x8f824]
main(0x1,0xffbefbfc,0xffbefc04,0x19b5f4,0x0,0x0) + 51c
        [savfp=0xffbefb98,savpc=0x2a320]

When I comment out the LoadModule and the AddModule
line, the HEAD request is OK:

telnet localhost 8088
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Wed, 24 Oct 2001 17:14:57 GMT
Server: Apache/1.3.22 (Unix) mod_perl/1.26
Last-Modified: Fri, 04 May 2001 00:00:38 GMT
ETag: "398ee-5b0-3af1f126"
Accept-Ranges: bytes
Content-Length: 1456
Connection: close
Content-Type: text/html
Content-Language: en

Connection closed by foreign host.

I had PHP 4.0.4pl1 running OK with the same apache.
This happened after I compiled 4.0.6 with the same
configuration and installed it over 4.0.4pl1.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-27 06:03 UTC] sniper@php.net
Did you do 'apachectl stop ; apachectl start' ??
Restart won't work.

--Jani

 [2001-10-28 11:50 UTC] sniper@php.net
Try removing mod_perl and see if it works then.

--Jani

 [2001-10-29 03:28 UTC] lupe at lupe-christoph dot de
No crash when Apache is configured without mod_perl.
 [2001-10-29 23:14 UTC] sniper@php.net
Have you compiled Apache with: --enable-rule=SHARED_CORE

--Jani
 [2001-10-29 23:25 UTC] sniper@php.net
Another thing if the previous one didn't help might
be that the fix for largefile support in Perl has
been reverted accidently. You could try disabling that.

--Jani

 [2001-10-30 05:26 UTC] lupe at lupe-christoph dot de
--enable-rule=SHARED_CORE is quite bad, during the mod_perl
"make test" (without the PHP DSO):
/sw/WORK/apache_1.3.22/src/httpd: Unable to exec Shared Core Executable Program `/opt/OCTOapache-1.3.22/libexec/libhttpd.ep'
I would have assumed that the default DSO handling on Solaris
should work. This is not a exotic platform for Apache.

I don't understand the comment about largefile support.
Should it or should it not be switched on in perl?

In any case, I found a workaround - statically linking
*both* mod_perl and PHP makes the crash go away. Seems that
the problem is DSO related.

I changed my PHP config from --with-apxs to --with-apache,
included --activate-module=src/modules/php4/libphp4.a
in the mod_perl configuration and that's all.

I'm willing to look into this more, but I'd need some
guidance where to look.

 [2001-10-30 17:59 UTC] sniper@php.net
Maybe in Solaris 6 / 7 but not necessarily with 8.
I think you need to compile both mod_perl and PHP as DSO's.
And always use that --enable-rule=SHARED_CORE 
The largefile support should work but you could try
if everything else fails to turn it off.

--Jani


 [2001-11-20 11:02 UTC] sander@php.net
No feedback. Closing.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 10 22:01:26 2025 UTC