On 4 Aug 2009, at 03:14, dan...@zoltak.com wrote:

Quoting Jani Taskinen <jani.taski...@sci.fi>:

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 <and the 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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to