HTML::Parser hangs at EOF on unterminated start tag
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Perl
- Stelle
- 64
- Fork
- 6
- Merge medio
- 4h 53m
- PR unite (30g)
- 165
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
fglock/PerlOnJava#1341 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
fglock/PerlOnJava#1524 ·
I maintainer di solito rispondono entro 2 giorni
-
area:backend area:runtime bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
fglock/PerlOnJava#1523 ·
I maintainer di solito rispondono entro 2 giorni
-
area:backend area:cpan-port bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
fglock/PerlOnJava#1522 ·
I maintainer di solito rispondono entro 2 giorni
-
area:backend area:io area:unicode bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
fglock/PerlOnJava#1520 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di fglock/PerlOnJava
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
openfoodfacts/openfoodfacts-server#14724 ·
I maintainer di solito rispondono entro 1 giorno
-
question
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
Bug Priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
canonical/chisel-releases#1235 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
linuxmuster/sophomorix4#190 ·