Skip to content

PHP 8.5.12 CLI Segfault (exit code 2) when running PHPUnit 12 on Ubuntu 26.04 #25208

Closed as not planned

Description

@xiaxia9615

Description

Description

I am experiencing a hard CLI segmentation fault (exit code 2) when running a PHPUnit test suite. The crash occurs on the latest PHP 8.5.12 release, even though the 8.5.12 changelog mentions fixes for several JIT segfaults (e.g., GH-20890, GH-24388).

PHPUnit only outputs Fatal error: Premature end of PHP process when running <TestClass>::<method>. The crash is highly reproducible on Ubuntu 26.04 but does not happen on PHP 8.3.

Environment

  • OS: Ubuntu 26.04 LTS (also reproducible on GitHub Actions ubuntu-latest which recently migrated to Ubuntu 26)
  • PHP Version: PHP 8.5.12 (cli) (built: Oct 21 2026)
  • PHPUnit Version: 12.5.37 (Laravel 13)
  • SAPI: CLI
  • OpCache: Enabled (JIT is on by default in CLI). Note: The crash still occurs even when JIT is explicitly disabled via -d opcache.enable_cli=0.

Steps to Reproduce

  1. Clone a Laravel 13 project with ~145 feature/unit tests.
  2. Run php artisan test (which invokes vendor/bin/phpunit).
  3. The process silently crashes and exits with code 2 right at Tests\Feature\Admin\AdminFinanceTest::test_plain_admin_gets_403_on_approve_withdrawal_post.

Expected Behavior

All tests should pass without crashing the CLI process.

Actual Behavior

The process terminates abruptly with exit code 2. No standard PHP fatal error is logged.

Additional Context

  • Running a single test file (AdminFinanceTest.php alone) passes successfully.
  • Running the full suite crashes at the exact same method every time.
  • The code is fully compatible with PHP 8.5, and all 12 architecture tests pass. This appears to be an engine-level issue specifically triggered by the full test suite execution on Ubuntu 26.04.
  • Downgrading to PHP 8.3 on the exact same codebase resolves the issue completely.

PHP Version

PHP 8.5.12 (cli) (built: Oct 21 2026 08:07:33) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.5.12, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.12, Copyright (c), by Zend Technologies

Operating System

Ubuntu 26.04 LTS (Tencent Cloud VM)

Activity

  1. arshidkv12 commented on Nov 5, 2026

    @arshidkv12
    Contributor

    Note: The test Tests\Feature\Admin\AdminFinanceTest::test_plain_admin_gets_403_on_approve_withdrawal_post does not exist in the Laravel framework repository or https://github.com/laravel/laravel

  2. xiaxia9615 commented on Nov 6, 2026

    @xiaxia9615
    Author

    为造成的噪音致歉 —— 这是我这边的一场乌龙。我判断得太急了,把 PHPUnit 的输出误读成了引擎级 segfault。

    应用层的 FatalError(Class App\Models\Withdrawal cannot extend final class ...)首次记录于 2026-11-05 12:52:37。修好
    final class
    继承问题后,故障就消失了。退出码 2 的 Premature end of PHP process 和 SIGSEGV 不是一回事。

    为占用 triage 时间致歉,也感谢 @arshidkv12 的快速核查。关闭此 issue。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions