Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45208 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28178 invoked from network); 4 Aug 2009 03:19:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2009 03:19:23 -0000 Authentication-Results: pb1.pair.com header.from=scott@macvicar.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=scott@macvicar.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain macvicar.net from 97.107.131.220 cause and error) X-PHP-List-Original-Sender: scott@macvicar.net X-Host-Fingerprint: 97.107.131.220 whisky.macvicar.net Linux 2.6 Received: from [97.107.131.220] ([97.107.131.220:50725] helo=whisky.macvicar.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 39/71-43528-AB8A77A4 for ; Mon, 03 Aug 2009 23:19:22 -0400 Received: from [192.168.1.105] (macvicar.demon.co.uk [80.177.111.173]) by whisky.macvicar.net (Postfix) with ESMTP id B60783C8D2E; Mon, 3 Aug 2009 23:19:18 -0400 (EDT) Cc: jani.taskinen@iki.fi, Jani Taskinen , internals@lists.php.net Message-ID: <374A7AD0-D3BE-4FAE-BBBF-9B08D3A613E5@macvicar.net> To: daniel@zoltak.com In-Reply-To: <20090804121441.wuq024oznoc88c4o@webmail.zoltak.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Tue, 4 Aug 2009 04:19:16 +0100 References: <20090731101017.jcs6fiyk0sg4gcok@webmail.zoltak.com> <4A72A254.8030808@sci.fi> <4A7545C4.60202@zoltak.com> <4A75A950.6030701@sci.fi> <4A760126.9070002@lerdorf.com> <4A76199F.9040701@sci.fi> <20090803145207.l09o05kib4ow8448@webmail.zoltak.com> <4A76993F.5000401@sci.fi> <20090803215255.0vh3a3gif4wk8o0w@webmail.zoltak.com> <4A76D3DB.4040106@sci.fi> <20090803221910.mmhi8jy20o48gc00@webmail.zoltak.com> <4A76D997.5090008@sci.fi> <20090804121441.wuq024oznoc88c4o@webmail.zoltak.com> X-Mailer: Apple Mail (2.935.3) Subject: Re: [PHP-DEV] fopen_wrappers.c DOCUMENT_ROOT .htaccess error From: scott@macvicar.net (Scott MacVicar) On 4 Aug 2009, at 03:14, daniel@zoltak.com wrote: > Quoting Jani Taskinen : > >> Yes. You shouldn't really do it like that. Unpack it in separate >> directory. And build outside the sources: >> >> # tar zxfv php5.2-xxxxx.tar.gz >> # mkdir php_5_2 >> # cd php_5_2 >> # ../php5.2-xxxxx/configure --disable-all --enable-debug > rest >> of relevant options here> >> # make >> # make install > > I couldn't get the direct SVN checkout to compile so I compiled the > latest SNAP as above with the same result with the previous gdb. > > Again the segmentation fault occurs when an .htaccess is defined > with an error_log and the custom_open_base_check is introduced that > does a DOCUMENT_ROOT lookup. In PHP 5.2.6 this worked without issue. > I have noticed the problem is intermittent i.e. it fails about 9/10 > times. > > My questions are: > > 1. Is it safe to lookup the DOCUMENT_ROOT in fopen_wrappers. If not > is there an alternative? Not at the point the function is being executed on a fresh child start PHP hasn't always been fully started by the time it's doing the config merging. None of the SAPI variables have been imported. You might be able to use sapi_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT")) Another solution is to skip doing you check before the SAPI is loaded :-) > > 2. Why was this working in PHP 5.2.6 but now broken in 5.2.1x? Are you sure you were using 5.2.6? We never checked the error_log value until 5.2.4, it's the first version to have it. > > 3. Is the problem related to Zend doing something it shouldn't? Doubtful, the reason its erroring is because the hash table you've given it isn't a hash table at that point. It's random memory. Scott