HTML::Parser hangs at EOF on unterminated start tag
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 78/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Perl
- Étoiles
- 64
- Forks
- 6
- Merge moyen
- 4 h 42 min
- PR mergées (30 j)
- 182
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de fglock/PerlOnJava
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
fglock/PerlOnJava#1579 ·
Les mainteneurs répondent en général sous 1 jour
-
area:cpan-port area:unicode bug
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
fglock/PerlOnJava#1341 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 4/5 3-5 jours Accessibilité débutants 68/100
fglock/PerlOnJava#1578 ·
Les mainteneurs répondent en général sous 1 jour
-
area:runtime area:warnings bug high-impact
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
fglock/PerlOnJava#1577 ·
Les mainteneurs répondent en général sous 1 jour
-
area:cpan-port area:regex area:unicode bug
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
fglock/PerlOnJava#1556 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de fglock/PerlOnJava
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 87/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
objectionary/eolang.sty#184 ·
-
Remote IMAP SSL setting is not inherited by discovered folders, causing port 143 connectionsOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
linux-test-project/lcov#542 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100