Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

bzip2.decompress stream wrapper truncates valid bz2 files from pbzip2

オープン
#24,170 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@kairosci がすでに取り組んでいます。

2026年10月25日 から。

  • #24690 @kairosci による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
57/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c, php
領域
api, backend

調査の方向性

Start by comparing the compress.bzip2:// wrapper path with the bzip2.decompress stream filter, using the provided PHP example as a reproducer. Trace where concatenated-stream handling differs and add a regression test for the wrapper with two concatenated bz2 streams; done means both reads return 900004 bytes without truncation.

索引モデルが issue の本文から書いたものです。

説明

Bug Extension: bz2 Status: Verified
Description

pbzip2 slices a file into 900000 byte blocks and then concatenates the streams. The default PHP behavior for using libbzip2 stops after the first concatenated stream without warning. This results in silently truncated reads.

The following code:

<?php
$f = tempnam(sys_get_temp_dir(), 'bz');
file_put_contents($f, bzcompress(str_repeat('a', 900000)) . bzcompress('tail'));  // two streams
echo strlen(file_get_contents("compress.bzip2://$f")), "\n";   // 900000 if truncated, 900004 if not
$fp = fopen($f, 'rb');
stream_filter_append($fp, 'bzip2.decompress', STREAM_FILTER_READ, ['concatenated' => true]);
echo strlen(stream_get_contents($fp)), "\n";                   // 900004

Resulted in this output:

900000
900004

But I expected this output instead:

900004
900004
PHP Version
PHP 8.5.11 (cli) (built: Sep 24 2026 14:38:36) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.5.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.11, Copyright (c), by Zend Technologies
Operating System

Debian 12.15

主要言語
C
スター
40.7k
フォーク
8.3k
平均マージ
2日 16時間
マージ済み PR(30日)
151

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

php/php-src のほかの issue

php/php-src の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。