ID: 14529 Updated by: [EMAIL PROTECTED] -Summary: script doesn't always finish output Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Output Control Operating System: Linux RH 7.2 -PHP Version: 4.1.1 +PHP Version: 4.1.2 New Comment:
We are getting closer, I've got a small team of people at this end working on solving this bug and are now trying to dedicate much more time and money into getting this bug solved! (Our business success depends on it) The problem, we only know PHP programming well and are weaker in the server end of things (I'm the only one with some Linux knowledge) so we need your help to solve this. Here is a summary of all things done so far to narrow this down (much already due to your help). We've seperated everything into sections below. PROBLEM: While running some more complex PHP scripts they will not work on anything newer than 4.0.6 but works 100% on 4.0 -> 4.0.6. The page simply stops displaying part ways through a script (usually right in the middle of an echo statement or between echo statements). The script seemed to finish commands past the point of where it stopped but is only known through the sessions (seeing nothing else is being displayed to screen) But, we've discovered when this crash happens where it has been giving us problems as well so we can not confirm this anymore. APACHE ERROR_LOG: When a page is loaded with my problem scripts I get either 1 or 2 errors in my apache error_log: [date] [notice] child pid #### exit signal Segmentation fault (11) (if two errors the second is the same except different pid number) SCRIPTS CAUSING CRASHES: These scripts that cause the problems have been in development for almost 3 years now and are fairly complex. Not all scripts give me hassles, but from the tests I have done, it appears only scripts that have sessions AND use fairly large hashes (passed into and out from sessions via serialize() functions) is where I have problems. Even complex or large scripts without this in it seem to run fine. All scripts run fine in PHP versions 4.0.6 or older but not since 4.1.0 or newer (up to 4.2.2) PHP compiling configurations: Have tried compiling with various combinations of options trying to narrow down if a particular option is what is causing the problems. So far I can not find anything consistent. GDB RESULTS: You gave me the link to the generating bug-traces and I'm having problems getting it to run apache properly. I could not find a core file on my server. (Apache isn't generating them, or I simply can not find them). So I've been using your suggested method of running the script through gdb itself. Here is what I've done so far. Stopped the apache server (tested going to web page and confirmed it was down), I then typed: gdb /usr/sbin/httpd run -X (from inside the gdb prompt) It then says it's starting /usr/sbin/httpd with a new thread and then starts a new blank line (while it's waiting for an apache crash signal). If at this point I use my browser and go to plain html web page it works (so that tells me the apache server is running again), BUT if I go to a php page, I get a page not available error. This means I am unable to load the pages that will make apache crash. What am I doing wrong to get apache running with PHP through the gdb? Also, once httpd is started through gdb, how do I stop it and exit gdb - I can CNTL-C but apache keeps running and I can't find the process to kill it. There must be a cleaner way. Previous Comments: ------------------------------------------------------------------------ [2002-02-18 13:29:41] [EMAIL PROTECTED] I think i had something similar happen to me. It would just stop printing to the screen and either spit out crazy characters or stop altogether. I commented out every line and brought it back one by one until i located the problem. Although i'm still not exactly sure what's going on I might have a solution. (worked in my case) I put a flush() every now and then. It seemed to fix the problem. ------------------------------------------------------------------------ [2002-02-15 20:23:31] [EMAIL PROTECTED] I've followed the instructions on the gdb backtrace page but I can not find a core file anywhere on the site. When I tried running httpd -X in the gdb itself I can not access the page. I'm using RedHat 7.2 on my test server. I ran the command (to test it) /usr/sbin/httpd -X and it starts fine and no prompt comes back (which I think is normal). The moment I open a webpage it returns the line: Segmentation fault and then goes back to the command prompt. So this would tell me I found the right command line to run but when I try: gdb /usr/sbin/httpd run -X (from inside the gdb prompt) it says starting new thread and then locks up. If I try opening a web page it comes up as not found (just like it does when the httpd server is not running at all). Any tips on what I'm doing wrong. At least I've finally confirmed it is PHP crashing. I've tried compiling with various options enabled or disabled. I've got the --enable-debug take and I did not set the --enable-trans-sid this time. Thanks ------------------------------------------------------------------------ [2002-02-05 20:37:39] [EMAIL PROTECTED] To properly diagnose this bug, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". ------------------------------------------------------------------------ [2002-02-05 18:55:06] [EMAIL PROTECTED] When I use simple little scripts it seems to work fine. The pages where I have problems is where there are dynamically called include_once and variable variables used. For me the output seemed to work at first with output.buffering on but it turns out there was problems on other pages then (that weren't bothered by it being off). And IE6 would simply load pages from cache of old pages (and Netscape would simply crash with a connection lost error) I also discovered that some environmental variables working with sessions would fail to if there was a tiny error on html output at least in one consistent test. Example: If I had page (such as index.php) generate a basic HTML page but within the html code generated there was an <img> tag with an image name that did not exist on the server anymore (I had renamed it and forgot to update that script). The browser just shows standard little box with x in it where image should be as usual. When this was happening, if I echoed the value of $HTTP_SERVER_VARS['PHP_SELF'] it would return index.php (or the name of the page). However, if I saved that value to a session, then even though a test before the script end showed it correctly set, upon reloading it would be set to the page name (image.gif). I have tried the compiling with AND without --enable-trans-sid and these errors still continue with no change. I have to keep my production server on php 4.0.6 as it simply is way to unreliable in 4.1.0 or newer (including 4.2.2-dev). I use a lot of serialize/unserialize and really was hoping to upgrade for the performance differences. ------------------------------------------------------------------------ [2002-02-05 18:38:03] [EMAIL PROTECTED] And what happens when you get rid of --enable-trans-sid from your confiugre line? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/14529 -- Edit this bug report at http://bugs.php.net/?id=14529&edit=1
