JIT bug: composer install sometimes hangs
まだ誰も着手していません。
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
composer install sometimes hangs when JIT is on and set to tracing. I created a reproducing repo that shows the problem: https://github.com/ondrejmirtes/composer-hang-repro
Disclaimer: Claude Code helped me create the reproducer. The repo contains two Dockerfiles (with JIT on/off) that shows the difference in behaviour and loop.sh script that runs composer install over and over and shows that it hangs in about 3 % of performed runs.
There are some details in the README but consider them with a grain of salt.
To reproduce the problem in the cloned link repository:
# Build both images (PHP 8.5.6 + Composer 2.9.5)
docker build -t composer-jit-hang -f Dockerfile.jit .
docker build -t composer-jit-nojit -f Dockerfile.nojit .
# 1) See the hang with opcache.jit=tracing.
# loop.sh bootstraps vendor/ on first run (one ~30 s install to bring in
# Symfony Flex, which has to be loaded as a plugin for the JIT bug to
# fire), then runs `composer install --dry-run` 200 times. Expect a
# handful of those runs to be killed at the 15 s deadline — last
# measurement: 19 hangs in 500 runs.
docker run --rm \
-v "$PWD":/work \
composer-jit-hang bash /loop.sh 200
# 2) Same project, same Composer, same PHP, JIT off — zero hangs.
docker run --rm \
-v "$PWD":/work \
composer-jit-nojit bash /loop.sh 200
PHP Version
PHP 8.5.6 (cli) (built: May 8 2026 19:23:57) (NTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Operating System
Debian 13.4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされた composer-hang-repro リポジトリをクローンし、まず Dockerfile.jit と Dockerfile.nojit をビルドしてから、loop.sh を実行して Composer のインストールを繰り返した場合を比較します。README を読み、トレーシング設定に関係する PHP JIT/OPcache の動作を調べます。トレーシングを有効にした reproducer で、示されているハングが理解され、発生しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- docker, php
- 領域
- compilers, performance
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100