Tracing JIT: intermittent segfault in JIT buffer in long-running CLI command (PHP 8.5.12, opcache.jit=tracing)

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php
領域
performance

調査の方向性

The report points to a crash in tracing JIT generated code with CLI Opcache settings, but no core dump, backtrace, or failing command is available yet. Start by reproducing the crash with PHP 8.5.12, opcache.jit=tracing, and the reported 128M buffer, then capture a backtrace and the failing command. Done means identifying a reproducible cause and fixing the intermittent segfault.

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

説明

Bug Status: Needs Triage
Description

A Laravel scheduled CLI command (php artisan schedule:run, run every minute by cron) intermittently segfaults inside JIT-generated code.

It happens in bursts: once it starts, nearly every hourly run of the same scheduled workload crashes for 1–2 days (36 crashes on one day, 21 the next), then it stops on its own after unrelated code/data changes and does not recur for days.

Kernel log at the time of a crash:

php[3844339]: segfault at 0 ip 00005648b9e003eb sp 00007ffcd6eb38b0 error 4 in zero (deleted)[5648b9e00000+8000000]

The faulting instruction is inside an anonymous 0x8000000 (128M) mapping, which matches opcache.jit_buffer_size=128M, i.e. JIT-generated code.

No core dump or backtrace is available yet (the crashes stopped before one could be captured). I will add a backtrace and the failing command when the next burst happens.

Opcache settings (CLI):

opcache.enable=1
opcache.enable_cli=1
opcache.jit=tracing
opcache.jit_buffer_size=128M

Resulted in this output:

Segmentation fault (exit code 139)

But I expected this output instead:

The command completes normally.
PHP Version
PHP 8.5.12 (cli) (NTS), LiteSpeed lsphp85 build
Operating System

AlmaLinux 9, x86_64 (OpenLiteSpeed)

主要言語
C
スター
41.8k
フォーク
8.6k
平均マージ
2日 15時間
マージ済み PR(30日)
125

環境構築

はじめの一歩

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

php/php-src のほかの issue

php/php-src の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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