Skip to content

Symfony JIT 1205 assertion failure #17966

Closed
@nielsdos

Description

@nielsdos

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions