php / php/php-src

Error when killing script: Object of class UnwindExit could not be converted to string

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

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

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

説明

Description

I am running PHP 8.2.8 and PHP 8.3.0 Beta 1, and at times, I get this error when killing a cli script:

Object of class UnwindExit could not be converted to string

It's been tricky to reproduce, but I can intermittently get the error by:

  1. Unzip attached code.zip.
  2. Run: php -n test.php
  3. Immediately press Ctrl-C.

If no errors appear, repeat running the script and pressing Ctrl-C.

The error I get is:

Warning: Uncaught Error: Object of class UnwindExit could not be converted to string in /tmp/test/a.php:2
Stack trace:
#0 /tmp/test/test.php(4): require()
#1 /tmp/test/test.php(14): {closure}('a')
#2 {main}
  thrown in /tmp/test/a.php on line 2

Fatal error: During class fetch: Uncaught  in /tmp/test/a.php on line 2

I believe the error comes up when the script is killed while one of the classes is being loaded.

Please let me know if I can provide more information to narrow it down.

Thanks for your help.

PHP Version

PHP 8.2.8 and PHP 8.3.0 Beta 1

Operating System

Linux

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

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

はじめの一歩

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

調査の方向性

code.zip を展開し、/tmp/test/test.php と /tmp/test/a.php から始めます。php -n test.php を実行し、スクリプトがクラスを読み込んでいる間に Ctrl-C を押します。この再現に関連する CLI の割り込みとクラス読み込みの経路を追跡します。スクリプトを強制終了したときに、断続的な UnwindExit 変換エラーが発生しなくなれば完了です。

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

評価

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

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

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