php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10230 Apache Segmentation Fault
Submitted: 2001-04-07 20:41 UTC Modified: 2001-04-08 22:02 UTC
From: spud at nothingness dot org Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0.4pl1 OS: Mac OS X 10.0
Private report: No CVE-ID: None
 [2001-04-07 20:41 UTC] spud at nothingness dot org
While developing a complex PHP application, I wrote an 
include file that generates a simple web-based form. This 
include file is accessed through one of 2 different pages 
(admins.php or members.php). When the file is included in 
admins.php, everything works peachy. When the file is 
included in members.php, the form only partially displays, 
Apache generates a seg fault, and the page is never 
rendered. This problem occurred on only one other script 
page that I noticed.


I originally discovered this with an OS X install (on a 
dual-G4, built from packages found on the web), but copied 
all the relevant files to a Linux PPC machine (604e) with 
different build options, and encountered the same problem 
there. Then I copied the files to an OpenBSD machine, and 
did NOT see the problem (which leads me to believe it may 
be processor related).

I built a new version of PHP to include --enable-debug and 
a few other options (gd, trans-sid), and now even MORE 
pages generate seg faults, though a simple php_info() page 
works fine.

I'm including below a copy of the Apache seg fault error 
line, and the backtrace. Happy to allow access to php_info 
upon request...

Apache's error log reads:
[Sat Apr  7 20:18:18 2001] [notice] child pid 25681 exit 
signal Segmentation fault (11)

No core is dumped (Mac OS X doesn't seem to do this).

Running Apache under gdb as instructed generates this 
backtrace:
#0  0x00ee7a4c in execute (op_array=0x9179b4) at ./
zend_execute.c:925
#1  0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#2  0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#3  0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#4  0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#5  0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#6  0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#7  0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#8  0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#9  0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#10 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#11 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#12 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#13 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#14 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#15 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#16 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#17 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#18 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#19 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#20 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#21 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#22 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#23 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#24 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#25 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#26 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#27 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#28 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#29 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#30 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#31 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#32 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#33 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#34 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#35 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#36 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#37 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#38 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#39 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#40 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#41 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#42 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#43 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#44 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#45 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#46 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#47 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#48 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#49 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#50 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#51 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#52 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#53 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#54 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#55 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#56 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#57 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#58 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#59 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#60 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#61 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#62 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#63 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#64 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#65 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#66 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#67 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#68 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#69 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#70 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#71 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#72 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#73 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#74 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#75 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#76 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#77 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#78 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#79 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#80 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#81 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#82 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#83 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#84 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#85 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#86 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#87 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#88 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#89 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#90 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#91 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#92 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#93 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#94 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#95 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#96 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#97 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#98 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#99 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#100 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#101 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#102 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#103 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#104 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#105 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#106 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#107 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#108 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#109 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#110 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#111 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#112 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#113 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#114 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#115 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#116 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#117 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#118 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#119 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#120 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#121 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#122 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#123 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#124 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#125 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#126 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#127 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#128 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#129 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#130 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#131 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#132 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#133 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#134 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#135 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#136 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#137 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#138 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#139 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#140 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#141 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#142 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#143 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#144 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#145 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#146 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#147 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#148 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#149 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#150 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#151 0x00eebcd8 in execute (op_array=0x916fc4) at ./
zend_execute.c:1559
#152 0x00eebcd8 in execute (op_array=0x6f8e84) at ./
zend_execute.c:1559
#153 0x00eebcd8 in execute (op_array=0xa65880) at ./
zend_execute.c:1559
#154 0x00eebcd8 in execute (op_array=0x69ac94) at ./
zend_execute.c:1559
#155 0x00eebcd8 in execute (op_array=0x9179b4) at ./
zend_execute.c:1559
#156 0x00eebcd8 in execute (op_array=0xa64950) at ./
zend_execute.c:1559
#157 0x00eebcd8 in execute (op_array=0x6ff094) at ./
zend_execute.c:1559
#158 0x00eebcd8 in execute (op_array=0xa69690) at ./
zend_execute.c:1559
#159 0x00eebcd8 in execute (op_array=0xa56a54) at ./
zend_execute.c:1559
#160 0x00eee4cc in execute (op_array=0xa53144) at ./
zend_execute.c:2063
#161 0x00ed15b0 in zend_execute_scripts (type=8, 
file_count=3) at zend.c:729
#162 0x00f1fcf0 in php_execute_script (primary_file=
0xbffff698) at main.c:1221
#163 0x00f1b9b8 in apache_php_module_main (r=0xa4e9a4, 
display_source_mode=0) at sapi_apache.c:89
#164 0x00f1988c in send_php (r=0xa4e9a4, 
display_source_mode=0, filename=0xa505dc "/Library/
WebServer/Documents/spud/members.php") at mod_php4.c:516
#165 0x00f198dc in send_parsed_php (r=0xa4e9a4) at 
mod_php4.c:527
#166 0x0000cab4 in ap_invoke_handler ()
#167 0x00016b0c in process_request_internal ()
#168 0x00016b88 in ap_process_request ()
#169 0x000062d4 in child_main ()
#170 0x00006490 in make_child ()
#171 0x000065fc in startup_children ()
#172 0x00006c00 in standalone_main ()
#173 0x00007484 in main ()
#174 0x0000265c in _start ()
#175 0x0000249c in start ()
#176 0x00001000 in ?? ()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-08 01:38 UTC] spud at nothingness dot org
After careful rewriting of several code segments that 
contributed to the conditions causing the crash, I appear 
to have resolved the problem. I can now attribute the 
circumstances to bad coding somewhere, but there was 
nonetheless something un-graceful about PHP's handling of 
the error. I'll leave the bug open for now in case someone 
wants to look at cleaning up PHP's manner of handling the 
error, but close it if appropriate.
 [2001-04-08 01:54 UTC] sniper@php.net
It would help a lot if you would add a shortest possible
self containing script into this report which could be used
to reproduce this. And you should also try with latest CVS
snapshot from http://snaps.php.net/

--Jani

 [2001-04-08 03:22 UTC] spud at nothingness dot org
I was desperately searching for code fragments that seemed 
to reproduce the problem, but I ran into it in the midst of 
an EXTREMELY large object-oriented app built on top of a 
full-blown generic PHP object framework...the page on which 
the error was generated was parsing at least 1500 lines of 
code before executing. Given that I was getting NO output 
for feedback, it was impossible to tell during what segment 
of execution PHP was tanking.

I've written tens of thousands of lines of PHP code, and 
never ran into this problem before, so I knew it wasn't a 
simple matter, and wasn't likely to be captured in a short, 
self-contained script. Not much help for tracking down the 
problem, I know, but it is likely that it was a case of a 
whole series of events/variable declarations/parse errors 
that all contributed to the crash. Altering the code in 
several places at once (since most functionality was 
dependant upon other functionality) was the only way I 
managed to resolve the issue and stop the crashes.
 [2001-04-08 22:02 UTC] bbonev@php.net
i am almost sure this is the infinite include problem. e.g.

a.php:
<?include 'a.php'?>

it is known and can be fixed using include_once/require_once

if you have found something different, please reopen
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Aug 13 03:01:29 2020 UTC