#35575 [Opn->Bgs]: gettext call segfaults with memory allocation error
| From: | tony2001@php.net | Date: | Wed, 07 Dec 2005 08:39:18 +0000 |
| Subject: | #35575 [Opn->Bgs]: gettext call segfaults with memory allocation error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-89872@lists.php.net to get a copy of this message | ||
ID: 35575
Updated by: tony2001@php.net
Reported By: tokul at users dot sourceforge dot net
-Status: Open
+Status: Bogus
Bug Type: Gettext related
Operating System: OpenBSD 3.8
PHP Version: 5CVS-2005-12-06 (snap)
New Comment:
If it happens because OpenBSD developers rewrote malloc()'s code -
report that problem to them.
Previous Comments:
------------------------------------------------------------------------
[2005-12-07 09:34:06] tokul at users dot sourceforge dot net
It is specific to OpenBSD. They rewrote malloc code in v.3.8. You need
ru/LC_MESSAGES/test.mo file in order to reproduce it. I think any
compiled gettext translation file can be used for test.mo.
I can reproduce problem with standard gettext library distributed with
OpenBSD. gettext v.0.10.40.
If php is compiled against GNU gettext 0.14.3, script works as expected
without segfaults.
Backtrace
----
#0 0x00085e74 in ?? ()
#1 0xe92d2eb8 in ?? ()
#2 0x00000001 in ?? ()
#3 0x00000000 in ?? ()
#4 0x0cfbcc3e in _nl_find_domain () from
/usr/local/lib/libintl.so.1.1
Previous frame inner to this frame (corrupt stack?)
----
I'll try contacting OpenBSD devels.
------------------------------------------------------------------------
[2005-12-06 22:48:09] tony2001@php.net
JFYI: the reproduce script works perfectly fine on Linux and outputs:
Test
------------------------------------------------------------------------
[2005-12-06 22:41:39] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
------------------------------------------------------------------------
[2005-12-06 22:37:39] tokul at users dot sourceforge dot net
Description:
------------
If gettext extension manages to locate .mo file, script breaks with
memory allocation error.
php compiled with --disable-all --enable-cli --with-gettext
same error in 5.0.4 and 5.1.1.
do you need php.core file?
Reproduce code:
---------------
bindtextdomain('test','./');
textdomain('test');
setlocale(LC_ALL, 'ru_RU.UTF-8');
putenv('LC_ALL=ru_RU.UTF-8');
echo _("Test");
Expected result:
----------------
Test
Actual result:
--------------
tail of kdump
-----
15066 php CALL mmap(0,0x4395ef38,0x1,0x2,0x3,0,0,0)
15066 php RET mmap -1 errno 12 Cannot allocate memory
15066 php CALL mmap(0,0x4395f000,0x3,0x1002,0xffffffff,0,0,0)
15066 php RET mmap -1 errno 12 Cannot allocate memory
15066 php PSIG SIGSEGV SIG_DFL code 1 addr=0x58e64 trapno=1
15066 php NAMI "php.core"
-----
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35575&edit=1