Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symfony JIT 1205 assertion failure #17966

Closed
nielsdos opened this issue Mar 3, 2025 · 0 comments
Closed

Symfony JIT 1205 assertion failure #17966

nielsdos opened this issue Mar 3, 2025 · 0 comments

Comments

@nielsdos
Copy link
Member

nielsdos commented Mar 3, 2025

Description

Running Symfony using opcache.jit=1205 results in an assertion failure.
It results in:

ir_base[521] is in use list of ir_base[1]
php: php-8.4/ext/opcache/jit/ir/ir_check.c:394: ir_check: Assertion `ok' failed.

I reduced it to the following standalone PHP code:

<?php
function test($value, bool $test)
{
    $value = (float) $value;

    if ($test) {
        return $value * 2;
    }

    return $value;
}

var_dump(test(1.25, true));
var_dump(test(1.25, false));

This results in:

ir_base[115] is in use list of ir_base[1]
php-8.4/ext/opcache/jit/ir/ir_check.c:394: ir_check: Assertion `ok' failed.
Aborted (core dumped)

I tracked it down to the ir_split_partially_dead_node() function in the GCM, where we try to create a clone for an IR_COPY instruction, but that instruction has an extra data op in op2, and IR tries to add uses to op2 but it's not actually a real ir_ref as far as I understand.
I'll send a PR to IR.

PHP Version

8.4+

Operating System

No response

@nielsdos nielsdos self-assigned this Mar 3, 2025
nielsdos added a commit to nielsdos/ir that referenced this issue Mar 3, 2025
In this example code,
`ir_split_partially_dead_node()` tries to create a clone of an IR_COPY
instruction, but that instruction has an extra data op in op2.
IR tries to add uses to op2 but it's not actually a real ir_ref.
In this case, op2 is the number 1; if it were an ir_ref it would
correspond to the IR_START node, which seems wrong.
This patch adds an extra check to see if it's a real input.
nielsdos added a commit that referenced this issue Mar 6, 2025
This was fixed via dstogov/ir#109 which was
merged in cc70838.
nielsdos added a commit that referenced this issue Mar 6, 2025
* PHP-8.4:
  Add test for GH-17966
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant