#45239 [NoF->Opn]: Hang (99.9%CPU) when encoding_translation is on

From: Date: Tue, 27 Jan 2009 14:04:34 +0000
Subject: #45239 [NoF->Opn]: Hang (99.9%CPU) when encoding_translation is on
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-133248@lists.php.net to get a copy of this message
 ID:               45239
 User updated by:  pumuckel at metropolis dot de
 Reported By:      pumuckel at metropolis dot de
-Status:           No Feedback
+Status:           Open
 Bug Type:         mbstring related
 Operating System: Linux
 PHP Version:      5.2.6
 New Comment:

With following ini settings it is reproducable:

test.ini:
mbstring.strict_detection = 1
mbstring.encoding_translation=on
mbstring.http_input=auto
mbstring.internal_encoding=UTF-8

Just tried with current 5.3 CVS Version and php-cgi. The result is the
same: It's hanging around with 99.9% cpu usage.

Please switch strict_detection and encoding_translation on.
strit_detection is recommended to be used for correct iso-8859-*
detection as described in 

Bug #35711  	[PATCH] ISO-8859 charset not correctly detected


Previous Comments:
------------------------------------------------------------------------

[2008-08-09 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2008-08-01 23:41:17] moriyoshi@php.net

Please provide the short and self-contained example to reproduce the
problem. I could never reproduce the problem with the following way.

$ env REQUEST_METHOD=get QUERY_STRING=x=%fc
SCRIPT_FILENAME=/tmp/test.php php-cgi -c /tmp/test.ini

test.php:
<?php var_dump($_REQUEST); ?>

test.ini:
mbstring.encoding_translation=on
mbstring.http_input=auto
mbstring.internal_encoding=UTF-8


------------------------------------------------------------------------

[2008-06-11 15:02:26] pumuckel at metropolis dot de

Description:
------------
When mbstring.encoding_translation is set to on, and passing a variable
like x=%FC (ISO 'ü' character) the mb lib is hanging in itself.

Following settings are applyied (internal encoding is ISO):

Multibyte Support 	enabled
Multibyte string engine 	libmbfl
HTTP input encoding translation 	enabled
Multibyte (japanese) regex support 	enabled
Multibyte regex (oniguruma) version 	4.4.4
Multibyte regex (oniguruma) backtrack check 	On

mbstring extension makes use of "streamable kanji code filter and
converter", which is distributed under the GNU Lesser General Public
License version 2.1.

Directive	Local Value	Master Value
mbstring.detect_order	auto	no value
mbstring.encoding_translation	On	Off
mbstring.func_overload	0	0
mbstring.http_input	UTF-8,ISO-8859-15	pass
mbstring.http_output	ISO-8859-15	pass
mbstring.internal_encoding	ISO-8859-15	no value
mbstring.language	neutral	neutral
mbstring.strict_detection	On	Off
mbstring.substitute_character	no value	no value


Also not working with these settings (internal UTF8)
mbstring.detect_order	auto	auto
mbstring.encoding_translation	On	On
mbstring.func_overload	0	7
mbstring.http_input	UTF-8,ISO-8859-15	auto
mbstring.http_output	UTF-8	UTF-8
mbstring.internal_encoding	UTF-8	UTF-8
mbstring.language	neutral	neutral
mbstring.strict_detection	On	Off
mbstring.substitute_character	no value	no value

Reproduce code:
---------------
Pass a ?x=%FC as a parameter. When followed by other parameters, it is
working again.

Expected result:
----------------
No hang.

Actual result:
--------------
Hang (99.9% CPU usage). As a result the script will be aborted later on
with "Max execution time exceeded". The first line of PHP Code itself is
never called.

GDB Info:
(gdb) where
#0  0xb752e9d5 in mbfl_encoding_detector_judge () from
/usr/lib/apache2/modules/libphp5.so
#1  0xb753c93e in _php_mb_encoding_handler_ex () from
/usr/lib/apache2/modules/libphp5.so
#2  0xbffd34ec in ?? ()


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45239&edit=1



Thread (5 messages)

« previous php.bugs (#133248) next »