Skip to content

Worker reload (octane:reload) can SIGSEGV the whole process on aarch64: two opcache races in php-src #2714

Closed as not planned

Description

@iloveleon19

Prepared with an AI assistant; I reviewed the analysis and the numbers. The text below is AI-generated (quoted).

Symptom: right after a worker reload (Laravel Octane octane:reload, i.e. a config PATCH through the admin API), the FrankenPHP process exits with 139 and nothing in the log. Seen on aarch64 (AWS Graviton); not seen at reload on x86_64 in about 1867 cycles. In our runs it did not happen with opcache disabled (900 deploy cycles) or when restarting the container instead of reloading (140 cycles).

Both causes are in php-src opcache, in lock-free readers of shared memory:

  1. Inheritance cache entries were published before ZCSG(map_ptr_last): PHP-FPM worker SIGSEGV: run_time_cache map_ptr offset beyond CG(map_ptr_last) when a class is reached through the CE cache php-src#23637, fixed by 873a997d, expected in 8.4.27 / 8.5.12. Not going to PHP 8.2 / 8.3.
  2. Script hash entries are linked before they are fully written: opcache: zend_accel_hash_update() links new entries without a release barrier; lock-free lookups can see a half-initialised entry on aarch64 php-src#24319 (fix proposed).

What did not help, for reference: FrankenPHP 1.12.6, #2648, #2648 + #2645, php-src #22281, php-src #23881.

Opening this so people searching here find the php-src side; nothing needs to change in FrankenPHP as far as we can tell.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions