php / php/php-src

[jit] doctrine migrations behave weird and result in random errors and hanging processes

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

まだ誰も着手していません。

Bug Category: JIT Status: Needs Triage
主要言語
C
スター
40.4k
フォーク
8.2k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

Description

The following code: https://github.com/verfriemelt-dot-org/doctrine-migrations-repro

Resulted in this output:

$ php -d opcache.jit=on bin/console doc:mi:mi -vv --no-interaction
[notice] Migrating up to DoctrineMigrations\Version_1000
[info] ++ migrating DoctrineMigrations\Version_0001
[debug] CREATE TABLE tab_0001 ()
[info] Migration DoctrineMigrations\Version_0001 migrated (took 22.3ms, used 10M memory)
[info] ++ migrating DoctrineMigrations\Version_0002

***hangs at 100% cpu***

or fails with strange errors instead. disabling jit does solve the issue. check out the reproducer, which results in the hanging process, on a private project it fails with

In TableDoesNotExist.php line 16:

  [Doctrine\DBAL\Schema\Exception\TableDoesNotExist]
  There is no table with name "customer_anonymisation_request" in the schema.


Exception trace:
  at ./core/vendor/doctrine/dbal/src/Schema/Exception/TableDoesNotExist.php:16
 Doctrine\DBAL\Schema\Exception\TableDoesNotExist::new() at ./core/vendor/doctrine/dbal/src/Schema/Schema.php:226
 Doctrine\DBAL\Schema\Schema->getTable() at ./core/vendor/doctrine/dbal/src/Schema/Comparator.php:64
 Doctrine\DBAL\Schema\Comparator->compareSchemas() at ./core/vendor/doctrine/migrations/src/Provider/DBALSchemaDiffProvider.php:53
 Doctrine\Migrations\Provider\DBALSchemaDiffProvider->getSqlDiffToMigrate() at ./core/vendor/doctrine/migrations/src/Provider/LazySchemaDiffProvider.php:90
 Doctrine\Migrations\Provider\LazySchemaDiffProvider->getSqlDiffToMigrate() at ./core/vendor/doctrine/migrations/src/Version/DbalExecutor.php:144
 Doctrine\Migrations\Version\DbalExecutor->executeMigration() at ./core/vendor/doctrine/migrations/src/Version/DbalExecutor.php:72
 Doctrine\Migrations\Version\DbalExecutor->execute() at ./core/vendor/doctrine/migrations/src/DbalMigrator.php:87
 Doctrine\Migrations\DbalMigrator->executePlan() at ./core/vendor/doctrine/migrations/src/DbalMigrator.php:54
 Doctrine\Migrations\DbalMigrator->executeMigrations() at ./core/vendor/doctrine/migrations/src/DbalMigrator.php:134
 Doctrine\Migrations\DbalMigrator->migrate() at ./core/vendor/doctrine/migrations/src/Tools/Console/Command/MigrateCommand.php:225
 Doctrine\Migrations\Tools\Console\Command\MigrateCommand->execute() at ./core/vendor/symfony/console/Command/Command.php:291
 Symfony\Component\Console\Command\Command->run() at ./core/vendor/symfony/console/Application.php:1092
 Symfony\Component\Console\Application->doRunCommand() at ./core/vendor/symfony/framework-bundle/Console/Application.php:123
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at ./core/vendor/symfony/console/Application.php:356
 Symfony\Component\Console\Application->doRun() at ./core/vendor/symfony/framework-bundle/Console/Application.php:77
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at ./core/vendor/symfony/console/Application.php:195
 Symfony\Component\Console\Application->run() at ./core/bin/console:100

which is completly unrelated to the migration, so i expect this to be a jit bug rather than a bug in doctrine 🤔

PHP Version
php -v
PHP 8.5.3 (cli) (built: Feb 13 2026 15:50:47) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.5.3, Copyright (c) Zend Technologies
    with Xdebug v3.5.0, Copyright (c) 2002-2025, by Derick Rethans
    with Zend OPcache v8.5.3, Copyright (c), by Zend Technologies
Operating System

debian sid

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

リンクされた doctrine-migrations-repro プロジェクトから始め、提供されている bin/console doc:mi:mi コマンドを PHP 8.5.3 と opcache.jit を有効にした状態で実行し、その後 JIT を無効にした場合と比較します。OPcache JIT パスから migration stack のエントリをたどって失敗を追跡し、ハングまたは無関係なスキーマエラーについて、再現可能な JIT 固有の原因を特定します。

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

評価

技術スタック
php
領域
compilers, performance
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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