php / php/php-src

JIT bug: composer install sometimes hangs

Offen
#22,086 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bug Category: JIT Status: Needs Triage
Vorherrschende Sprache
C
Sterne
40.4k
Forks
8.1k
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
96

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Klonen Sie das verknüpfte Repository composer-hang-repro und beginnen Sie damit, Dockerfile.jit und Dockerfile.nojit zu erstellen. Führen Sie anschließend loop.sh aus, um wiederholte Composer-Installationen zu vergleichen. Lesen Sie das README und untersuchen Sie das beteiligte PHP-JIT/OPcache-Verhalten in der Tracing-Konfiguration. Erledigt ist die Aufgabe, wenn die demonstrierten Hänger verstanden sind und unter dem Reproducer mit aktiviertem Tracing nicht mehr auftreten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
docker, php
Bereich
compilers, performance
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.