#38577 [Fbk->Opn]: ini settings leak between virtual hosts with Apache 1.3
| From: | php at diptyque dot net | Date: | Thu, 07 Sep 2006 16:39:50 +0000 |
| Subject: | #38577 [Fbk->Opn]: ini settings leak between virtual hosts with Apache 1.3 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-101842@lists.php.net to get a copy of this message | ||
ID: 38577
User updated by: php at diptyque dot net
Reported By: php at diptyque dot net
-Status: Feedback
+Status: Open
Bug Type: Apache related
Operating System: FreeBSD 4.4
PHP Version: 4.4.4
New Comment:
FYI, I do *NOT* have any Zend or Xdebug extension
installed... I have downloaded Xdebug only to compare its
overriding technique with the one used in Mbstring
extension.
=begin
[diptyque] % php -m
[PHP Modules]
bz2
ctype
curl
gd
imap
mbstring
mysql
openssl
overload
pcre
posix
readline
session
sqlite
standard
tokenizer
xml
zlib
[Zend Modules]
=end
BTW, I compared source files for apache SAPI
(./sapi/apache/mod_php4.c) and mbstring extension
(./ext/mbstring/mbstring.c) between version 4.4.4 and
latest stable version and did not find anything different
(!?)
Previous Comments:
------------------------------------------------------------------------
[2006-09-07 15:25:39] tony2001@php.net
Please remove all zend_extensions, including XDebug and try again.
------------------------------------------------------------------------
[2006-09-07 15:14:49] php at diptyque dot net
Antony, I'm not very familiar with Zend Engine 1.3 innards
but I had a look at how Xdebug is overriding both
var_dump() and set_time_limit() functions in
PHP_RINIT_FUNCTION(xdebug) and how it does restore the
original function pointers in
PHP_RSHUTDOWN_FUNCTION(xdebug). Peeking at mbstring
extension source code, this looks a bit more verbose and it
doesn't fiddle directly with
orig->internal_function.handler (!?) to restore the
original function. Instead it calls subsequently
zend_hash_update() and zend_hash_del() using the info it
gathered inside its mb_overload_def struct... IMHO,
mbstring ini settings are properly reset (please see
http://bugs.php.net/bug.php?id=25753) but not the
initial
PHP function table state.
------------------------------------------------------------------------
[2006-09-07 09:29:53] php at diptyque dot net
Sorry but it doesn't make it. Mbstring function overloading
setting is unfortunately persistent once an Apache process
has served content from a vhost where this ini parameter is
assigned a value distinct from zero.
------------------------------------------------------------------------
[2006-09-06 16:31:20] tony2001@php.net
Fixed, thanks.
What about your issue?
------------------------------------------------------------------------
[2006-09-06 16:13:00] php at diptyque dot net
Just downloaded the latest stable release, built it and ran
the test suite and mb_strlen() test case failed because
AFAIK this version of PHP (4.4.5-dev) doesn't emit
catchable errors yet (E_RECOVERABLE_ERROR). Anyway I'm
going to install it tomorrow morning and will let you know
ASAP if it does fix the ini settings leak between virtual
hosts.
===========================================================
=====================
/usr/local/src/php4-STABLE-200609061230/ext/mbstring/tests/
mb_strlen.phpt
===========================================================
=====================
---- EXPECTED OUTPUT
== ASCII ==
40
40
== EUC-JP ==
43
72
== SJIS ==
43
72
== JIS ==
43
90
== UTF-8 ==
43
101
== WRONG PARAMETERS ==
ERR: Notice
5
ERR: Catchable fatal error
ERR: Notice
6
ERR: Warning
---- ACTUAL OUTPUT
== ASCII ==
40
40
== EUC-JP ==
43
72
== SJIS ==
43
72
== JIS ==
43
90
== UTF-8 ==
43
101
== WRONG PARAMETERS ==
ERR: Notice
5
ERR: Notice
6
ERR: Warning
---- FAILED
===========================================================
=====================
019- ERR: Catchable fatal error
019+ ERR: Notice
020- ERR: Notice
020+ 6
021- 6
021+ ERR: Warning
022- ERR: Warning
===========================================================
=====================
------------------------------------------------------------------------
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/38577
--
Edit this bug report at http://bugs.php.net/?id=38577&edit=1