Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

HTML::Parser hangs at EOF on unterminated start tag

Aperta
#1,528 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java, perl
Ambito
backend

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

area:backend area:cpan-port area:parser area:runtime bug

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fglock/PerlOnJava

Tutte le issue di fglock/PerlOnJava

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.