|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-08-05 08:15 UTC] mike@php.net
-Status: Open
+Status: Verified
-Assigned To:
+Assigned To: mike
[2014-08-05 08:15 UTC] mike@php.net
[2014-08-05 08:18 UTC] mike@php.net
[2014-08-05 08:19 UTC] mike@php.net
[2014-08-05 13:49 UTC] mike@php.net
[2014-08-05 13:49 UTC] mike@php.net
-Status: Verified
+Status: Closed
[2014-08-11 07:43 UTC] dmitry@php.net
[2014-08-14 00:52 UTC] tyrael@php.net
[2014-08-20 20:15 UTC] stas@php.net
[2014-08-21 08:28 UTC] jpauli@php.net
[2014-08-21 08:47 UTC] jpauli@php.net
[2014-08-27 03:17 UTC] tyrael@php.net
[2014-10-07 23:13 UTC] stas@php.net
[2014-10-07 23:24 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 10:00:01 2025 UTC |
Description: ------------ The `zlib.inflate` filter silently fails in some circumstances. The attached test case creates highly compressed files, then reads them in chunks of 4 KiB with two chained `zlib.inflate` filters. When the original data is larger than 25 MB, something breaks and I have no idea what or why. Test script: --------------- ini_set('display_startup_errors', 1); ini_set('display_errors', 1); error_reporting(-1); /* Create a doubly-gzipped file, then read it back using zlib filters * and report how many KiB were decompressed. */ function create_and_read($f, $kb) { system("dd count=$kb bs=1024 </dev/zero 2>/dev/null | gzip | gzip >| $f"); $in = fopen($f, 'rb'); $out = 0; $args = array('window' => 30); stream_filter_prepend($in, 'zlib.inflate', STREAM_FILTER_READ, $args); stream_filter_prepend($in, 'zlib.inflate', STREAM_FILTER_READ, $args); while (!feof($in)) $out += strlen(fread($in, 4096)); unlink($f); print "in: $kb KiB\tout: " . $out / 1024 . " KiB\n"; } foreach (array(10, 100, 10000, 24800, 24801, 100000) as $kb) create_and_read('/tmp/x', $kb); Expected result: ---------------- in: 10 KiB out: 10 KiB in: 100 KiB out: 100 KiB in: 10000 KiB out: 10000 KiB in: 24800 KiB out: 24800 KiB in: 24801 KiB out: 24801 KiB in: 100000 KiB out: 100000 KiB Actual result: -------------- in: 10 KiB out: 10 KiB in: 100 KiB out: 100 KiB in: 10000 KiB out: 10000 KiB in: 24800 KiB out: 24800 KiB in: 24801 KiB out: 0 KiB in: 100000 KiB out: 0 KiB