#35243 [Opn->Fbk]: Crashes in php_mblen when compiled with thread-safety on Linux
| From: | sniper@php.net | Date: | Thu, 17 Nov 2005 08:39:16 +0000 |
| Subject: | #35243 [Opn->Fbk]: Crashes in php_mblen when compiled with thread-safety on Linux | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-88347@lists.php.net to get a copy of this message | ||
ID: 35243
Updated by: sniper@php.net
Reported By: shulmanb at il dot ibm dot com
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 5.0.5
New Comment:
How about mailing it to internals@lists.php.net ?
Previous Comments:
------------------------------------------------------------------------
[2005-11-17 08:14:06] shulmanb at il dot ibm dot com
It still is a problem with the latest snapshot.
Since I don't have a server where I can host the diff file, please let
me know whether you want me to put it here (12 lines, which will
probably end up trunctated), or mail it to you.
Please let me know what you prefer.
------------------------------------------------------------------------
[2005-11-16 18:18:33] sniper@php.net
And if it's still a problem, provide the patch in unified diff format.
------------------------------------------------------------------------
[2005-11-16 18:18:10] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-11-16 16:07:01] shulmanb at il dot ibm dot com
Description:
------------
When running on Linux with --enable-maintainer-zts (and yes, I know
it's not wise...), crashes sometimes happen in
ext/standard/php_string.h when using the php_mblen macro.
This happens because in ext/standard/basic_functions.c, in the
basic_globals_ctor function, the value of mblen_state is not
initialized.
The basic_globals_ctor function should include the following lines as
part of the initialization:
#if defined(_REENTRANT)&&defined(HAVE_MBRLEN)&&defined(HAVE_MBSTATE_T)
memset(&BG(mblen_state), 0, sizeof(BG(mblen_state)));
#endif
Unfortunately, I am unable to include code that demonstrate this, as
the crash strongly depends on the (random) value of mblen_state.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35243&edit=1