Skip to content

Long match statement can segfault compiler during recursive SSA renaming #19065

Description

@AlliBalliBaba

Description

This issue was originally opened in the FrankenPHP repo, but I'm posting a minimal reproducer here as well since I'm not sure how to best debug this.

Basically, specific weird match statements will lead to hanging+crash in the alpine docker image (bookworm doesn't have this issue). The original file where this first was observed is this enum, but I created a minimal reproducer here:

https://github.com/AlliBalliBaba/franke-alpine-zts-crash

Hanging + crashing will only happen if the non-debug version of PHP is installed. As soon as I'm using a debug version like this, the crash will not happen anymore (essentially --with-debug when building PHP will prevent the crash).

Similarly, disabling opcache will also prevent the crash.

PHP Version

PHP 8.4.10 (cli) (built: Jul  3 2025 23:01:28) (ZTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.4.10, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.10, Copyright (c), by Zend Technologies

FrankenPHP v1.7.0 PHP 8.4.10 Caddy v2.10.0 h1:fonubSaQKF1YANl8TXqGcn4IbIRUDdfAkpcsfI/vX5U=

Operating System

Alpine 3.22.0

Activity

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