Bug #66885 [NEW]: fileinfo: tried to allocate 140162101026128 bytes

From: Date: Tue, 11 Mar 2014 18:49:30 +0000
Subject: Bug #66885 [NEW]: fileinfo: tried to allocate 140162101026128 bytes
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184730@lists.php.net to get a copy of this message
From: pratte at cybergeneration dot com Operating system: Slackware x64 14.1 PHP version: 5.5.10 Package: Reproducible crash Bug Type: Bug Bug description:fileinfo: tried to allocate 140162101026128 bytes Description: ------------ Allowed memory size exhausted: [Tue Mar 11 14:38:04.043122 2014] [:error] [pid 4606:tid 140163304847104] [client 192.168.0.14:47690] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 140162101026128 bytes) in Unknown on line 0 This code (below in Test script) was used in PHP 5.2 and was working fine. Upgraded to PHP 5.5.10 and we got those crashes. Removing the path to a magic database fixes the problem, but I'm still pretty curious about what's being logged in error_log, especially 'tried to allocate 140162101026128 bytes', that makes no sense to me Test script: --------------- $handle = new finfo(FILEINFO_MIME_TYPE, "/etc/file/magic.mgc"); The error goes away if we are using this instead: $handle = new finfo(FILEINFO_MIME_TYPE); Expected result: ---------------- Other thing I noticed is that the 'tried to allocate' bytes seem to be pretty similar to the Thread ID (tid) in the logs as well: # grep "bytes exhausted" /var/www/logs/error_log | awk '{ print "Tid:" $9, "Exhausted:" $25; }' | sed 's/]//g' Tid:140232007603968 Exhausted:140231237030816 Tid:140231999211264 Exhausted:140231845865648 Tid:140231948855040 Exhausted:140231845853360 Tid:140231940462336 Exhausted:140231847975088 Tid:140231957247744 Exhausted:140230820510528 Tid:140231932069632 Exhausted:140230690544128 Tid:140231940462336 Exhausted:140230901551760 Tid:140231864928000 Exhausted:140231845865648 Tid:140231932069632 Exhausted:140230283629488 Tid:140231890106112 Exhausted:140230216520624 Tid:140231873320704 Exhausted:140230420013472 Tid:140231890106112 Exhausted:140230285535344 Tid:140231923676928 Exhausted:140230758178176 Tid:140231881713408 Exhausted:140230554527856 Tid:140231864928000 Exhausted:140230216520624 Tid:140231873320704 Exhausted:140230151577184 Tid:140231915284224 Exhausted:140230350738352 Tid:140232015996672 Exhausted:140231492041808 Tid:140232015996672 Exhausted:140231426947520 Tid:140232120657664 Exhausted:140231695460112 Tid:140231974033152 Exhausted:140230961103872 Tid:140231965640448 Exhausted:140230688818752 -- Edit bug report at https://bugs.php.net/bug.php?id=66885&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66885&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66885&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66885&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66885&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66885&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66885&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66885&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66885&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66885&r=support Expected behavior: https://bugs.php.net/fix.php?id=66885&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66885&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66885&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66885&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66885&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66885&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66885&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66885&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66885&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66885&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66885&r=mysqlcfg

« previous php.bugs (#184730) next »