Bug #72561 [NEW]: 5.2.2 regressed with incorrect seeking in stream wrappers
| From: | nazar at mokrynskyi dot com | Date: | Fri, 08 Jul 2016 01:33:37 +0000 |
| Subject: | Bug #72561 [NEW]: 5.2.2 regressed with incorrect seeking in stream wrappers | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-202121@lists.php.net to get a copy of this message | ||
From: nazar at mokrynskyi dot com
Operating system: Linux
PHP version: 7.1.0alpha1
Package: Filesystem function related
Bug Type: Bug
Bug description:5.2.2 regressed with incorrect seeking in stream wrappers
Description:
------------
When doing reading/seeking on stream wrapper, PHP does interesting magic
under the hood (for instance, reading 3 bytes results in 8192 bytes
actually tried to be read in ::stream_read()).
This is all fine until it works as expected.
Here is demo: https://3v4l.org/3RG7r
PHP 5.1.4 - 5.2.1 have expected correct output.
hhvm-3.9.1 - 3.12.0 seems to also have optimizations under the hood, but
result is correct anyway.
PHP 5.2.2+ (including latest 7.1.0-alpha2) regressed and does incorrect
seeking which results in wrong position eventually.
I believe this should be fixed and backported to stable versions, since
I do not see any good workaround here, input in ::stream_seek() is
already incorrect.
--
Edit bug report at https://bugs.php.net/bug.php?id=72561&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72561&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72561&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72561&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72561&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72561&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72561&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72561&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72561&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72561&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72561&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72561&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72561&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72561&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72561&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72561&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72561&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72561&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72561&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72561&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72561&r=mysqlcfg