php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6134 httpd segfaults on PHP4 page request
Submitted: 2000-08-12 19:55 UTC Modified: 2000-08-17 11:18 UTC
From: anil at recoil dot org Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0 Latest CVS (14/08/2000) OS: Red Hat Linux 6.1
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: anil at recoil dot org
New email:
PHP Version: OS:

 

 [2000-08-12 19:55 UTC] anil at recoil dot org
Compiled from latest CVS, and the httpd dies on a php4 page request.  Apache 1.3.12 - runs 4.0.1pl2 fine.

Configure line was:

"./configure" \
"--with-apxs=/usr/local/apache/bin/apxs" \
"--with-mysql=/usr/local" \
"--with-mcal" \
"--with-imap" \
"--with-gettext" \
"--enable-versioning" \
"--with-gd" \

gdb reveals this:

[root@recoil.org php4]# gdb /usr/local/apache/bin/httpd
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
[Sun Aug 13 00:49:41 2000] [warn] NameVirtualHost 212.25.240.41:80 has no VirtualHosts

Program received signal SIGSEGV, Segmentation fault.
0x40674501 in ?? () from /usr/local/apache/libexec/libphp4.so
(gdb) bt
#0  0x40674501 in ?? () from /usr/local/apache/libexec/libphp4.so
#1  0x4065c7e6 in ?? () from /usr/local/apache/libexec/libphp4.so
#2  0x40668872 in ?? () from /usr/local/apache/libexec/libphp4.so
#3  0x40677c35 in ?? () from /usr/local/apache/libexec/libphp4.so
#4  0x40674900 in ?? () from /usr/local/apache/libexec/libphp4.so
#5  0x406751d6 in ?? () from /usr/local/apache/libexec/libphp4.so
#6  0x4067520c in ?? () from /usr/local/apache/libexec/libphp4.so
#7  0x806df73 in ap_invoke_handler ()
#8  0x8081919 in process_request_internal ()
#9  0x8081d48 in ap_internal_redirect ()
#10 0x806163d in handle_dir ()
#11 0x806df73 in ap_invoke_handler ()
#12 0x8081919 in process_request_internal ()
#13 0x808197c in ap_process_request ()
#14 0x807918e in child_main ()
#15 0x807933c in make_child ()
#16 0x8079499 in startup_children ()
#17 0x8079ac6 in standalone_main ()
#18 0x807a263 in main ()
#19 0x4007d1eb in __libc_start_main (main=0x8079f0c <main>, argc=2,
    argv=0xbffffcd4, init=0x804f614 <_init>, fini=0x80b03cc <_fini>,
    rtld_fini=0x4000a610 <_dl_fini>, stack_end=0xbffffccc)
    at ../sysdeps/generic/libc-start.c:90


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-14 07:31 UTC] anil at recoil dot org
I updated with CVS again, on the same system, and I still get a segfault when accessing index.php, but a different one:

[root@total php4]# gdb /usr/local/apache/bin/httpd  
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...r
u(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
[Mon Aug 14 12:25:21 2000] [warn] NameVirtualHost 212.25.240.41:80 has no VirtualHosts

Program received signal SIGSEGV, Segmentation fault.
0x400c2a93 in strncpy (s1=0x81c9788 "active_sessions", s2=0x825e79c "", n=4294967284)
    at ../sysdeps/generic/strncpy.c:82
82      ../sysdeps/generic/strncpy.c: No such file or directory.
(gdb) bt
#0  0x400c2a93 in strncpy (s1=0x81c9788 "active_sessions", s2=0x825e79c "", n=4294967284)
    at ../sysdeps/generic/strncpy.c:82
#1  0x406cb624 in ?? () from /usr/local/apache/libexec/libphp4.so
#2  0x406cd458 in ?? () from /usr/local/apache/libexec/libphp4.so
#3  0x4065c1d6 in ?? () from /usr/local/apache/libexec/libphp4.so
#4  0x4065c427 in ?? () from /usr/local/apache/libexec/libphp4.so
#5  0x4065c427 in ?? () from /usr/local/apache/libexec/libphp4.so
#6  0x4065c427 in ?? () from /usr/local/apache/libexec/libphp4.so
#7  0x4065c427 in ?? () from /usr/local/apache/libexec/libphp4.so
#8  0x4066886e in ?? () from /usr/local/apache/libexec/libphp4.so
#9  0x40677c21 in ?? () from /usr/local/apache/libexec/libphp4.so
#10 0x406748d9 in ?? () from /usr/local/apache/libexec/libphp4.so
#11 0x406751b6 in ?? () from /usr/local/apache/libexec/libphp4.so
#12 0x406751ec in ?? () from /usr/local/apache/libexec/libphp4.so
#13 0x806df73 in ap_invoke_handler ()
#14 0x8081919 in process_request_internal ()
#15 0x8081d48 in ap_internal_redirect ()
#16 0x806163d in handle_dir ()
#17 0x806df73 in ap_invoke_handler ()
#18 0x8081919 in process_request_internal ()
#19 0x808197c in ap_process_request ()
#20 0x807918e in child_main ()
#21 0x807933c in make_child ()
#22 0x8079499 in startup_children ()
#23 0x8079ac6 in standalone_main ()
#24 0x807a263 in main ()
#25 0x4007d1eb in __libc_start_main (main=0x8079f0c <main>, argc=2, argv=0xbffffce4, 
    init=0x804f614 <_init>, fini=0x80b03cc <_fini>, rtld_fini=0x4000a610 <_dl_fini>, 
    stack_end=0xbffffcdc) at ../sysdeps/generic/libc-start.c:90

Any further information needed to help track this one down?
 [2000-08-14 11:38 UTC] stas@php.net
Could you please enable debugging and then make a backtrace?
 [2000-08-14 12:01 UTC] anil at recoil dot org
I used this script to regenerate and build:

#!/bin/sh
for i in "Zend" "TSRM"; do
  cd $i;cvs update -Pd;cd ..
done
cvs update -Pd
./buildconf
make clean
./configure --enable-debug --with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr/local --with-mcal --with-imap --with-gettext --enable-versioning --with-gd && make 

I get exactly the same backtrace :(  Shown below in case its different ...

GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
[Mon Aug 14 16:55:38 2000] [warn] NameVirtualHost 212.25.240.41:80 has no VirtualHosts

Program received signal SIGSEGV, Segmentation fault.
0x400c2a93 in strncpy (s1=0x82dfb28 "active_sessions", s2=0x827999c "active_sessions", 
    n=4294967284) at ../sysdeps/generic/strncpy.c:82
82      ../sysdeps/generic/strncpy.c: No such file or directory.
(gdb) bt
#0  0x400c2a93 in strncpy (s1=0x82dfb28 "active_sessions", s2=0x827999c "active_sessions", 
    n=4294967284) at ../sysdeps/generic/strncpy.c:82
#1  0x406cb3c4 in ?? () from /usr/local/apache/libexec/libphp4.so
#2  0x406cbe96 in ?? () from /usr/local/apache/libexec/libphp4.so
#3  0x406cc515 in ?? () from /usr/local/apache/libexec/libphp4.so
#4  0x4065c854 in ?? () from /usr/local/apache/libexec/libphp4.so
#5  0x4065ca6c in ?? () from /usr/local/apache/libexec/libphp4.so
#6  0x4065ca6c in ?? () from /usr/local/apache/libexec/libphp4.so
#7  0x4065ca6c in ?? () from /usr/local/apache/libexec/libphp4.so
#8  0x4065ca6c in ?? () from /usr/local/apache/libexec/libphp4.so
#9  0x4066932e in ?? () from /usr/local/apache/libexec/libphp4.so
#10 0x40679041 in ?? () from /usr/local/apache/libexec/libphp4.so
#11 0x40675c79 in ?? () from /usr/local/apache/libexec/libphp4.so
#12 0x40676596 in ?? () from /usr/local/apache/libexec/libphp4.so
#13 0x406765cc in ?? () from /usr/local/apache/libexec/libphp4.so
#14 0x806df73 in ap_invoke_handler ()
#15 0x8081919 in process_request_internal ()
#16 0x8081d48 in ap_internal_redirect ()
#17 0x806163d in handle_dir ()
#18 0x806df73 in ap_invoke_handler ()
#19 0x8081919 in process_request_internal ()
#20 0x808197c in ap_process_request ()
#21 0x807918e in child_main ()
#22 0x807933c in make_child ()
#23 0x8079499 in startup_children ()
#24 0x8079ac6 in standalone_main ()
#25 0x807a263 in main ()
#26 0x4007d1eb in __libc_start_main (main=0x8079f0c <main>, argc=2, argv=0xbffffce4, 
    init=0x804f614 <_init>, fini=0x80b03cc <_fini>, rtld_fini=0x4000a610 <_dl_fini>, 
    stack_end=0xbffffcdc) at ../sysdeps/generic/libc-start.c:90
(gdb) 
 [2000-08-17 11:17 UTC] anil at recoil dot org
I've updated on the same system and script to latest CVS, and things compile and run now.

However, the include_path behaviour seems to have changed, and the '.' in my include_path is no longer being recognized - was this intended?  I can no longer include files as 'templates/blah.inc' which worked in a previous 4.0.2-dev checkout, and all earlier versions of PHP.

 [2000-08-17 11:18 UTC] stas@php.net
No, "." should work and it works for me. If you have reproducing case (i.e., include-path setup that doesn't work in lab conditions) please open a new bug report for that.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sun Oct 11 19:00:02 2026 UTC