php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57713 emalloc(): Unable to allocate 140733193388072 bytes
Submitted: 2007-06-21 06:51 UTC Modified: 2014-12-30 10:41 UTC
From: hs at web-gear dot com Assigned:
Status: No Feedback Package: translit (PECL)
PHP Version: 5.1.2 OS: SuSE Linux 10.1
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-06-21 06:51 UTC] hs at web-gear dot com
Description:
------------
I really like this extension and it works perfect on my old system. However, on my new system I cannot get it to work!
PHP-Scripts that use the "transliterate"-function simply do not have any output, no error message, nothing. Simply a plain white page. Maybe it is because of PHP5?

Reproduce code:
---------------
$string=iconv("utf-8", "ucs-2", $string);
$string=transliterate($string, array('diacritical_remove'));
$string=iconv("ucs-2", "utf-8", $string);


Expected result:
----------------
$string

Actual result:
--------------
*NOTHING*

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-21 07:35 UTC] hs at web-gear dot com
Ok it's not PHP5. Where could I find error messages?
 [2007-06-25 03:48 UTC] mail at webgear-office dot com
Now I found a error message in the Apache log: everytime "transliterate" is executed in a PHP script and I get the white screen, the following line is added to Apache error log:

FATAL:  emalloc():  Unable to allocate 140733193388072 bytes
 [2007-06-28 03:18 UTC] mail at webgear-office dot com
Script:
-------


$string = "abcdefgh";
$res = transliterate($string, array('han_transliterate', 'diacritical_remove'), 'utf-8', 'utf-8');
echo $res;




Valgrind output:
----------------



SuSE-101-64-minimal:~ # export USE_ZEND_ALLOC=0
SuSE-101-64-minimal:~ # valgrind php5 --php-ini /etc/php5/apache2/php.ini /srv/www/XXXXXXXXXX.php
==25220== Memcheck, a memory error detector.
==25220== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==25220== Using LibVEX rev 1575, a library for dynamic binary translation.
==25220== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==25220== Using valgrind-3.1.1, a dynamic binary instrumentation framework.
==25220== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==25220== For more details, rerun with: -v
==25220==
==25220== Conditional jump or move depends on uninitialised value(s)
==25220==    at 0x52B5F5: _emalloc (in /usr/bin/php5)
==25220==    by 0x6F9B7F3: php_iconv_string (in /usr/lib64/php5/extensions/iconv.so)
==25220==    by 0x5DAAEB2: zif_transliterate (translit.c:133)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
==25220==
==25220== Conditional jump or move depends on uninitialised value(s)
==25220==    at 0x52B5FA: _emalloc (in /usr/bin/php5)
==25220==    by 0x6F9B7F3: php_iconv_string (in /usr/lib64/php5/extensions/iconv.so)
==25220==    by 0x5DAAEB2: zif_transliterate (translit.c:133)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
==25220==
==25220== Conditional jump or move depends on uninitialised value(s)
==25220==    at 0x52B66F: _emalloc (in /usr/bin/php5)
==25220==    by 0x6F9B7F3: php_iconv_string (in /usr/lib64/php5/extensions/iconv.so)
==25220==    by 0x5DAAEB2: zif_transliterate (translit.c:133)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
==25220==
==25220== Use of uninitialised value of size 8
==25220==    at 0x52B70B: _emalloc (in /usr/bin/php5)
==25220==    by 0x6F9B7F3: php_iconv_string (in /usr/lib64/php5/extensions/iconv.so)
==25220==    by 0x5DAAEB2: zif_transliterate (translit.c:133)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
==25220==
==25220== Conditional jump or move depends on uninitialised value(s)
==25220==    at 0x52B68E: _emalloc (in /usr/bin/php5)
==25220==    by 0x6F9B7F3: php_iconv_string (in /usr/lib64/php5/extensions/iconv.so)
==25220==    by 0x5DAAEB2: zif_transliterate (translit.c:133)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
==25220==
==25220== Conditional jump or move depends on uninitialised value(s)
==25220==    at 0x6F9B802: php_iconv_string (in /usr/lib64/php5/extensions/iconv.so)
==25220==    by 0x5DAAEB2: zif_transliterate (translit.c:133)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
==25220==
==25220== Conditional jump or move depends on uninitialised value(s)
==25220==    at 0x5753C4E: __gconv_transform_utf8_internal (in /lib64/libc-2.4.so)
==25220==    by 0x574E157: __gconv (in /lib64/libc-2.4.so)
==25220==    by 0x574D6DE: iconv (in /lib64/libc-2.4.so)
==25220==    by 0x6F9B8B0: php_iconv_string (in /usr/lib64/php5/extensions/iconv.so)
==25220==    by 0x5DAAEB2: zif_transliterate (translit.c:133)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
==25220==
==25220== Conditional jump or move depends on uninitialised value(s)
==25220==    at 0x5753D33: __gconv_transform_utf8_internal (in /lib64/libc-2.4.so)
==25220==    by 0x574E157: __gconv (in /lib64/libc-2.4.so)
==25220==    by 0x574D6DE: iconv (in /lib64/libc-2.4.so)
==25220==    by 0x6F9B8B0: php_iconv_string (in /usr/lib64/php5/extensions/iconv.so)
==25220==    by 0x5DAAEB2: zif_transliterate (translit.c:133)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
==25220==
==25220== Conditional jump or move depends on uninitialised value(s)
==25220==    at 0x575018D: __gconv_transform_internal_ucs2 (in /lib64/libc-2.4.so)
==25220==    by 0x5753DEA: __gconv_transform_utf8_internal (in /lib64/libc-2.4.so)
==25220==    by 0x574E157: __gconv (in /lib64/libc-2.4.so)
==25220==    by 0x574D6DE: iconv (in /lib64/libc-2.4.so)
==25220==    by 0x6F9B8B0: php_iconv_string (in /usr/lib64/php5/extensions/iconv.so)
==25220==    by 0x5DAAEB2: zif_transliterate (translit.c:133)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
==25220==
==25220== Conditional jump or move depends on uninitialised value(s)
==25220==    at 0x574E179: __gconv (in /lib64/libc-2.4.so)
==25220==    by 0x574D6DE: iconv (in /lib64/libc-2.4.so)
==25220==    by 0x6F9B8B0: php_iconv_string (in /usr/lib64/php5/extensions/iconv.so)
==25220==    by 0x5DAAEB2: zif_transliterate (translit.c:133)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
==25220==
==25220== Conditional jump or move depends on uninitialised value(s)
==25220==    at 0x5DAB51F: han_transliterate_convert (han_transliterate.c:6197)
==25220==    by 0x5DAADB4: zif_transliterate (translit.c:142)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
==25220==
==25220== Conditional jump or move depends on uninitialised value(s)
==25220==    at 0x5DAB529: han_transliterate_convert (han_transliterate.c:6198)
==25220==    by 0x5DAADB4: zif_transliterate (translit.c:142)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
==25220==
==25220== Conditional jump or move depends on uninitialised value(s)
==25220==    at 0x5DAB561: han_transliterate_convert (han_transliterate.c:6197)
==25220==    by 0x5DAADB4: zif_transliterate (translit.c:142)
==25220==    by 0x57056D: (within /usr/bin/php5)
==25220==    by 0x5606FB: execute (in /usr/bin/php5)
==25220==    by 0x5427FD: zend_execute_scripts (in /usr/bin/php5)
==25220==    by 0x5068E9: php_execute_script (in /usr/bin/php5)
==25220==    by 0x5C128F: main (in /usr/bin/php5)
abcdefgh==25220==
==25220== ERROR SUMMARY: 41 errors from 13 contexts (suppressed: 2 from 1)
==25220== malloc/free: in use at exit: 1,600 bytes in 12 blocks.
==25220== malloc/free: 13,374 allocs, 13,362 frees, 2,543,588 bytes allocated.
==25220== For counts of detected errors, rerun with: -v
==25220== searching for pointers to 12 not-freed blocks.
==25220== checked 1,012,080 bytes.
==25220==
==25220== LEAK SUMMARY:
==25220==    definitely lost: 1,248 bytes in 10 blocks.
==25220==      possibly lost: 0 bytes in 0 blocks.
==25220==    still reachable: 352 bytes in 2 blocks.
==25220==         suppressed: 0 bytes in 0 blocks.
==25220== Use --leak-check=full to see details of leaked memory.
 [2007-10-07 18:15 UTC] iliakan at gmail dot com
Gentoo PHP 5.2.4.

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 140733193388084 bytes

That was cyrillic transliterate call.
 [2013-11-11 11:02 UTC] derick@php.net
-Status: Open +Status: Feedback
 [2013-11-11 11:02 UTC] derick@php.net
I can not reproduce this. Is this still a problem for you?
 [2014-12-30 10:41 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 14 21:01:24 2020 UTC