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

未关闭
#25,551 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
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 小时
30 天内合并 PR
125

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

php/php-src 的其他 Issue

查看 php/php-src 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。