Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.

X Report information
Id: 4065
Status: rejected
Left: 0 min
Priority: 0/0
Queue: HTML-Parser

Owner: Nobody
Requestors: blair [...] orcaware.com
Cc:
AdminCc:

Severity: Normal
Broken in: 3.31
Fixed in: (no value)



X History Display mode: Brief headersFull headers
#   Fri Oct 10 13:28:57 2003 BZAJAC - Ticket created  
Subject: t/tokeparser failure in 3.32 with Perl 5.004
[text/plain 1.8k]
Hi Gisle,

I'm only reporting this bug because HTML::Parser passed make test fine
with HTML::Parser 3.31 using Perl 5.004 (an impressive feat to keep this
Perl supported for so long). Now with HTML::Parser 3.32, I get this:

t/textarea...........ok
t/tokeparser.........Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 52.
Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 52.
t/tokeparser.........FAILED test 8
Failed 1/8 tests, 87.50% okay

BTW, Perl 5.005 passes make test just fine with 3.32.

Best,
Blair

% /opt/i386-linux/installed/perl-5.004_05/bin/perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 5) configuration:
Platform:
osname=linux, osvers=2.4.18-5, archname=i686-linux
uname='linux orcaware.com 2.4.18-5 #1 mon jun 10 15:31:48 edt 2002 i686 unknown '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=n useperlio=undef d_sfio=undef
Compiler:
cc='gcc', optimize='-O3', gccversion=3.1.1
cppflags='-Dbool=char -DHAS_BOOL'
ccflags ='-Dbool=char -DHAS_BOOL'
stdchar='char', d_stdstdio=undef, usevfork=false
intsize=4, longsize=4, ptrsize=undef, doublesize=undef
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='gcc', ldflags =''
libpth=/lib /usr/lib
libs=-lnsl -lgdbm -ldl -lm -lc -lcrypt
libc=/lib/libc-2.2.5.so, so=so
useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared'


Characteristics of this binary (from libperl):
Built under linux
Compiled at Aug 7 2002 11:02:36
@INC:
/opt/i386-linux/installed/perl-5.004_05/lib/i686-linux/5.00405
/opt/i386-linux/installed/perl-5.004_05/lib
/opt/i386-linux/installed/perl-5.004_05/lib/site_perl/i686-linux
/opt/i386-linux/installed/perl-5.004_05/lib/site_perl
.

#   Sat Oct 11 16:09:12 2003 GAAS - Correspondence added  
[text/plain 1.2k]
> I'm only reporting this bug because HTML::Parser passed make test fine
> with HTML::Parser 3.31 using Perl 5.004 (an impressive feat to keep
> this
> Perl supported for so long). Now with HTML::Parser 3.32, I get this:
>
> t/textarea...........ok
> t/tokeparser.........Use of uninitialized value at
> blib/lib/HTML/TokeParser.pm line 52.
> Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 52.
> t/tokeparser.........FAILED test 8
> Failed 1/8 tests, 87.50% okay

I don't really understand this yet, but this patch makes the
test pass on perl-5.004.

Index: lib/HTML/TokeParser.pm
===================================================================
RCS file: /cvsroot/libwww-perl/html-parser/lib/HTML/TokeParser.pm,v
retrieving revision 2.26
diff -u -p -r2.26 TokeParser.pm
--- lib/HTML/TokeParser.pm 10 Oct 2003 10:45:46 -0000 2.26
+++ lib/HTML/TokeParser.pm 11 Oct 2003 20:04:42 -0000
@@ -64,7 +64,7 @@ sub get_text
my $self = shift;
my @text;
while (my $token = $self->get_token) {
- my $type = $token->[0];
+ my $type = "$token->[0]";
if ($type eq "T") {
my $text = $token->[1];
decode_entities($text) unless $token->[2];

Without this the assigment to $type have the side effect
of making $token->[0] undef. Very strange.
#   Wed Oct 15 03:36:10 2003 GAAS - Status changed from 'new' to 'resolved'  
#   Tue Apr 06 11:30:07 2004 guest - Correspondence added  
[text/plain 2k]
[GAAS - Sat Oct 11 16:09:12 2003]:

> > I'm only reporting this bug because HTML::Parser passed make test fine
> > with HTML::Parser 3.31 using Perl 5.004 (an impressive feat to keep
> > this
> > Perl supported for so long). Now with HTML::Parser 3.32, I get this:
> >
> > t/textarea...........ok
> > t/tokeparser.........Use of uninitialized value at
> > blib/lib/HTML/TokeParser.pm line 52.
> > Use of uninitialized value at blib/lib/HTML/TokeParser.pm line 52.
> > t/tokeparser.........FAILED test 8
> > Failed 1/8 tests, 87.50% okay
>
> I don't really understand this yet, but this patch makes the
> test pass on perl-5.004.
>
> Index: lib/HTML/TokeParser.pm
> ===================================================================
> RCS file: /cvsroot/libwww-perl/html-parser/lib/HTML/TokeParser.pm,v
> retrieving revision 2.26
> diff -u -p -r2.26 TokeParser.pm
> --- lib/HTML/TokeParser.pm 10 Oct 2003 10:45:46 -0000 2.26
> +++ lib/HTML/TokeParser.pm 11 Oct 2003 20:04:42 -0000
> @@ -64,7 +64,7 @@ sub get_text
> my $self = shift;
> my @text;
> while (my $token = $self->get_token) {
> - my $type = $token->[0];
> + my $type = "$token->[0]";
> if ($type eq "T") {
> my $text = $token->[1];
> decode_entities($text) unless $token->[2];
>
> Without this the assigment to $type have the side effect
> of making $token->[0] undef. Very strange.


I am seeing this exact error with perl version 5.005_02 built for
sun4-solaris. If you look at the token array, you'll see that in fact
the first 2 elements are undef when they should not be. For instance,
in the following case I believe token->[1] should be 'img' but is undef:

DB<5> x $token
0 ARRAY(0x34fd7c)
0 undef
1 undef
2 HASH(0x34fce0)
'alt' => 'Perl'
'src' => 'camel.gif'
3 ARRAY(0x3ddf44)
0 'src'
1 'alt'
4 '<img src="camel.gif" alt="Perl">'

It looks like the problem occurs when parsing the HTML and building the
token array.

This doesn't appear to be a problem in later releases of perl.

id2001[...]cablelabs.com

#   Tue Apr 06 11:30:08 2004 RT_System - Status changed from 'resolved' to 'open'  
#   Sun Oct 23 17:45:22 2005 GAAS - Status changed from 'open' to 'stalled'  
#   Mon Nov 17 04:40:02 2008 GAAS - Correspondence added  
[text/plain 71b]
At this point I think I just declare those old perls as unsupported :-(
#   Mon Nov 17 04:40:04 2008 RT_System - Status changed from 'stalled' to 'open'  
#   Mon Nov 17 04:40:05 2008 GAAS - Status changed from 'open' to 'rejected'  
#   Mon Nov 17 04:40:05 2008 GAAS - Correspondence added  
[text/plain 71b]
At this point I think I just declare those old perls as unsupported :-(
#   Mon Nov 17 04:40:07 2008 RT_System - Status changed from 'rejected' to 'open'  
#   Mon Nov 17 04:40:08 2008 GAAS - Status changed from 'open' to 'rejected'