Bug #69020 [NEW]: Possible memory corruption on file error messages
| From: | php at maisqi dot com | Date: | Mon, 09 Feb 2015 22:26:17 +0000 |
| Subject: | Bug #69020 [NEW]: Possible memory corruption on file error messages | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-190553@lists.php.net to get a copy of this message | ||
From: php at maisqi dot com
Operating system: Windows 8.1
PHP version: 5.6.5
Package: Filesystem function related
Bug Type: Bug
Bug description:Possible memory corruption on file error messages
Description:
------------
If I try to handle a file whose name is ISO-8859-1 (on a NTFS file
system), and force some error, the error message is printed with some
unexpected chars, besides those that are to be expected when we cross
different character encodings.
I tested this on PHP5.5 and it worked ok. PHP 5.6, 32 bits or 64 bits,
print the strange chars and crashed a few times. I can't test this on
Linux for now.
Test script:
---------------
file_get_contents (utf8_decode ('Z:/Voláção'));
echo '<br />';
trigger_error(utf8_decode ('Z:/Voláção'), E_USER_WARNING);
trigger_error(utf8_decode ('Z:/Voláção'), E_USER_WARNING);
/**
* Note: I repeated the trigger_error() solely to prove that the output
* is not random.
*/
Expected result:
----------------
The script should emit three very similar error messages.
Actual result:
--------------
This is what I get on my system:
Warning: <`d��� : failed to open stream: No such file or
directory [...]
Warning: Z:/Vol���o in D:\Apache\exp\web\exp.php on line 22
Warning: Z:/Vol���o in D:\Apache\exp\web\exp.php on line 23
The «garbage» chars are quite different in the first message. I
suspect this is due to some memory corruption bug. In fact, this simple
script crashes once in a while (at least on my system).
--
Edit bug report at https://bugs.php.net/bug.php?id=69020&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69020&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69020&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69020&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69020&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69020&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69020&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69020&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69020&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69020&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69020&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69020&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69020&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69020&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69020&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69020&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69020&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69020&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69020&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69020&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69020&r=mysqlcfg