JIT bug: composer install sometimes hangs
Nessuno ha ancora preso questa issue.
- Lingua principale
- C
- Stelle
- 40.4k
- Fork
- 8.1k
- Merge medio
- 2g 13h
- PR unite (30g)
- 96
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Clona il repository collegato composer-hang-repro e inizia creando Dockerfile.jit e Dockerfile.nojit, quindi esegui loop.sh per confrontare installazioni ripetute di Composer. Leggi il README e analizza il comportamento di PHP JIT/OPcache coinvolto nella configurazione del tracing. Il lavoro è completo quando i blocchi dimostrati sono compresi e non si verificano più nel reproducer con il tracing abilitato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, php
- Ambito
- compilers, performance
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100