html5 parser crash: dom_html_collection_named_item: Assertion `iter.candidate->type == XML_ELEMENT_NODE' failed.
まだ誰も着手していません。
評価
調査の方向性
Start at ext/dom/html_collection.c:58 and the dom_html_collection_named_item function, then reproduce the provided Dom\HTMLDocument chain on PHP 8.7. The work is done when the input no longer aborts with the assertion; preserve the example as a regression check if the repository's existing test structure supports it.
索引モデルが issue の本文から書いたものです。
説明
Description
The following code:
<?php
Dom\HTMLDocument::createFromString(<<<a
<!DOCTYPE html>
<b id="container">
a)
->getElementById('container')
->getElementsByClassName('')
->namedItem("here");
Resulted in this output:
php: /home/user/software/php-install/src/ext/dom/html_collection.c:58: dom_html_collection_named_item: Assertion `iter.candidate->type == XML_ELEMENT_NODE' failed.
Aborted
PHP Version
PHP 8.7.0-dev (cli) (built: Sep 23 2026 15:02:26) (NTS DEBUG)
Copyright © The PHP Group and Contributors
Zend Engine v4.7.0-dev, Copyright © Zend by Perforce
with Zend OPcache v8.7.0-dev, Copyright ©, by Zend by Perforce
Operating System
Ubuntu 24.04
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 15時間
- マージ済み PR(30日)
- 113
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
php/php-src のほかの issue
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
Bug Status: Needs Triage
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Bug Category: Tests Status: Verified
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Bug SAPI: fpm Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
zephyrproject-rtos/zephyr#120318 · コメント 1 件 ·
-
issue: bug report
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
darktable-org/darktable#22386 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100