HTML::Parser hangs at EOF on unterminated start tag
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start at the shared Java-backed HTMLParser.parseHtml() and flushBufferedAtEof() paths described in the issue, then reproduce with the unterminated <foo a=b input under both JVM and interpreter backends. Verify that eof() terminates, emits the remaining malformed input, and no longer retries an unchanged buffer; run HTML-Tree 5.07's t/parsefile.t to confirm the timeout is resolved.
索引モデルが issue の本文から書いたものです。
説明
Summary
PerlOnJava hangs indefinitely when the Java-backed HTML::Parser reaches EOF with an unterminated start tag. This causes HTML-Tree 5.07's t/parsefile.t to time out.
Reproduction
use HTML::TreeBuilder;
open my $fh, '>', '/tmp/input.html' or die $!;
print {$fh} "<foo a=b\n";
close $fh;
my $tree = HTML::TreeBuilder->new;
print "before parse_file\n";
$tree->parse_file('/tmp/input.html');
print "after parse_file\n";
With PerlOnJava 0.7.0-dev, both commands hang until killed:
timeout 30 ./jperl probe_html_parsefile.pl
timeout 30 ./jperl --interpreter probe_html_parsefile.pl
Changing the input to <foo a=b> completes successfully.
Observed CPAN failure
HTML-Tree 5.07 passes through t/parse.t, then stalls in t/parsefile.t until the CPAN tester's soft timeout. The archived failure log is:
/tmp/cpan_random_logs/20260925-103132-20451/failures/HTML-TreeBuilder--from--HTML-TreeBuilder.log
System Perl passes the complete distribution suite: 23 files and 989 tests.
Root cause
HTMLParser.parseHtml() correctly buffers an incomplete tag at EOF, but flushBufferedAtEof() repeatedly feeds that unchanged buffer back into parseHtml(). The parser re-buffers the same input, so the EOF flush loop never makes progress.
The problem is in the shared Java-backed parser and reproduces under both the JVM and interpreter backends; it is not specific to HTML::TreeBuilder or to file I/O.
Expected behavior
eof() should terminate and emit the remaining malformed input according to Perl HTML::Parser semantics, without retrying an unchanged buffer forever.
- 主要言語
- Perl
- スター
- 64
- フォーク
- 6
- 平均マージ
- 4時間 53分
- マージ済み PR(30日)
- 165
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fglock/PerlOnJava のほかの issue
-
area:cpan-port area:unicode bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
fglock/PerlOnJava#1341 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
fglock/PerlOnJava#1524 ·
メンテナーはふだん 2 日以内に返信
-
area:backend area:runtime bug
難易度 4/5 3〜5日 初心者へのやさしさ 65/100
fglock/PerlOnJava#1523 ·
メンテナーはふだん 2 日以内に返信
-
area:backend area:cpan-port bug
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
fglock/PerlOnJava#1522 ·
メンテナーはふだん 2 日以内に返信
-
area:backend area:io area:unicode bug
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
fglock/PerlOnJava#1520 ·
メンテナーはふだん 2 日以内に返信
fglock/PerlOnJava の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
openfoodfacts/openfoodfacts-server#14724 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
rubocop/ruby-style-guide#982 ·
-
question
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
-
Bug Priority
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
canonical/chisel-releases#1235 ·
メンテナーはふだん 1 日以内に返信