HTML::Parser hangs at EOF on unterminated start tag
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 78/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Perl
- Estrellas
- 64
- Forks
- 6
- Merge medio
- 4 h 55 min
- PR fusionados (30 d)
- 169
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
fglock/PerlOnJava#1341 ·
Los mantenedores suelen responder en 1 día
-
area:cpan-port area:regex area:unicode bug
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
fglock/PerlOnJava#1556 ·
Los mantenedores suelen responder en 1 día
-
area:backend area:runtime bug
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
fglock/PerlOnJava#1554 ·
Los mantenedores suelen responder en 1 día
-
area:cpan-port area:runtime bug
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
fglock/PerlOnJava#1552 ·
Los mantenedores suelen responder en 1 día
-
area:backend area:cpan-port bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
fglock/PerlOnJava#1548 ·
Los mantenedores suelen responder en 1 día
Todos los issues de fglock/PerlOnJava
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
openfoodfacts/openfoodfacts-server#14749 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rubocop/ruby-style-guide#982 ·
-
Strange loop in AgentTicketBulkAbiertobug question
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
RotherOSS/otobo#6172 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100