php / php/php-src

Assertion failure Zend/Optimizer/zend_inference.c:2086

オープン
#17,144 コメント 4 件 リアクション 2 件 担当者 0 名 GitHub で見る

@iliaal がすでに取り組んでいます。

2026年4月8日 から。

  • #21674 @iliaal による — オープン
Bug Category: Optimizer Status: Verified
主要言語
C
スター
40.4k
フォーク
8.2k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

Description

The following code:

<?php
require "connect.inc";
$link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
insert_dummy_data($link, $base);
$result = ldap_list($link, "$base", "(objectClass=person)");
$entry = ldap_first_entry($link, $result);
var_dump(
$entry = ldap_next_entry($link, $entry),
ldap_get_values($link, $entry, 'sn'),
$entry = ldap_next_entry($link, $entry)
);
$fusion = $base;
function renderRawGraph(array $parents) {
$fusion = array();
foreach ($parents as $p) {
foreach ($graph as $graph) {
$graph[$graph]['line'] = 1;
}
$graph[] = array(
'line' => 1,
);
}
}

Resulted in this output:

Warning: Narrowing occurred during type inference of ZEND_FETCH_DIM_W. Please file a bug report on https://github.com/php/php-src/issues in /tmp/test.php on line 17
php: /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/Optimizer/zend_inference.c:2086: void emit_type_narrowing_warning(const zend_op_array *, zend_ssa *, int): Assertion `0 && "Narrowing during type inference"' failed.
Aborted (core dumped)

To reproduce (only in JIT):

-d "zend_extension=/home/phpfuzz/WorkSpace/flowfusion/php-src/modules/opcace.so" -d "opcache.enable=1" -d "opcache.enable_cli=1" -d "opcache.jit=1254"
PHP Version

nightly

Operating System

ubuntu 22.04

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Zend/Optimizer/zend_inference.c:2086 から始め、opcache JIT を有効にした PHP nightly と、提供された PHP スニペットを使ってアサーションを再現してください。完了条件は、例が型推論の警告を出力せず、アサーションのパスで中断もしないことです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, php
領域
compilers
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。