php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40437 decompress.bzip2 is broken
Submitted: 2007-02-11 21:05 UTC Modified: 2008-11-10 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: phpbugger dot 5 dot n1 at spamgourmet dot com Assigned: tony2001 (profile)
Status: No Feedback Package: Bzip2 Related
PHP Version: 5.2.1 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
19 + 9 = ?
Subscribe to this entry?

 
 [2007-02-11 21:05 UTC] phpbugger dot 5 dot n1 at spamgourmet dot com
Description:
------------
(See example code) - when using the bzip2.decompress filter on a http://-stream, php uses a lot of CPU resources and hangs. Decompressing with bzdecompress works, however, as does using zlib.decompress filters on .gz files via HTTP.

Reproduce code:
---------------
<?php

$url = 'http://php.net/backend/notes/all.bz2';
$url = 'http://de.archive.ubuntu.com/ubuntu/dists/edgy/restricted/binary-i386/Packages.bz2';

/* this works: */
$data = bzdecompress(file_get_contents($url));
echo "bzdecompress is finished!\n";



/* however, file_get_contents will block while PHP uses a lot of CPU time */
$fp = fopen($url,'rb');
stream_filter_append($fp, 'bzip2.decompress');
stream_get_contents($fp);
echo "stream_get_contents is finished!\n"

?>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-11 21:36 UTC] mark at mlstuff dot co dot uk
Using the read/write parameter STREAM_FILTER_READ seems to fix this.

stream_filter_append($fp, 'bzip2.decompress', STREAM_FILTER_READ);
 [2008-11-02 12:40 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2008-11-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC