Re: Apache+php3 coredumps: more funk..

From: Date: Fri, 05 Nov 1999 16:29:51 +0000
Subject: Re: Apache+php3 coredumps: more funk..
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-12202@lists.php.net to get a copy of this message
~ : ~ :This is suspicious. fp mucks with the Apache request rec and the problem ~ :you are seeing it exactly what I would expect if PHP was compiled against ~ :the pre-mucked request_rec structure. Are you 100% sure you are doing a ~ :complete make clean build of PHP after installing FP and the FP patches? ~ : ~ :I'll bet you a donut that if you remove fp from the equation you will not ~ :be able to reproduce this problem. Yes. I run several other servers with apache+mod_perl+php and never faced such problem. Plus, I just looked into fp source, and looks like it alters request_res structure exactly at the place, where php fails: --- apache_1.3.9.orig/src/include/httpd.h Mon Aug 16 13:57:53 1999 +++ apache_1.3.9/src/include/httpd.h Sat Aug 21 11:59:15 1999 @@ -774,7 +774,12 @@ char *unparsed_uri; /* the uri without any parsing performed */ char *uri; /* the path portion of the URI */ - char *filename; + char *execfilename; /* physical filename to exec */ + char *filename; /* logical filename to exec -- always the same + * except for FrontPage CGI programs where we + * will execute the CGI program in + * /usr/local/frontpage.... + ... Althrough it never alters the `filename' itself much (except placing some ending zero at some place), only works with execfilename, but since the the struct size is being changed and filename now sits after execfilename (thus if one had bcopy(a,b,HARDCODED_SIZE); filename would be set to NULL, or some random junk (if b has been used before). if m$ had a clue, they would probably place it backwards order, like: - char *filename; + char *filename; /* logical filename to exec -- always the + char *execfilename; /* physical filename to exec */ but they never do :(. Looks like I would have to fix things by hand here. It would be still good to have some error_checking possibilities in php, so the admin wouldn't get stuck with a coredump and no clue what's going on in php modules (perl module seem to check externally passed arguments so far I glanced). I finally fixed it to be something like this, so I could track down any further problems: --- alloc.c.orig Fri Nov 5 20:23:02 1999 +++ alloc.c Fri Nov 5 21:24:23 1999 @@ -264,6 +264,12 @@ int length; char *p; + if (!s) { + char buf[]="_estrdup: NULL argument has been passed\n"; + php3_log_err(buf); + return NULL; + } + length = strlen(s)+1; BLOCK_INTERRUPTIONS; #if DEBUG thanks for the help and pointers. regards, Fyodor

« previous php.dev (#12202) next »