Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.95k stars 554 forks source link

Problem with 5.8.1 and XML::Simple #6807

Closed p5pRT closed 16 years ago

p5pRT commented 21 years ago

Migrated from rt.perl.org#24084 (status was 'resolved')

Searchable as RT24084$

p5pRT commented 21 years ago

From dave@rudedog.org

Created by dave@rudedog.org

I just upgraded to perl 5.8.1 (using Debian/unstable) and it seems to have broken XML​::Simple. Basically\, XML​::Simple is creating a hash data structure as expected\, but every key and value is empty. After adding some diagnostics to the XML​::Simple source\, I found some extreme strangeness that looks like a Perl bug.

The problem code and its output is below. Both Dumper($element) and keys %{$element} show that $element is a hashref that has a `Name' key\, but after the $name = $element->{Name} assignment\, $name remains undefined.

- Code ----------------------------------------------------------------- sub start_element {   my $self = shift;   my $element = shift;

  print STDERR "Dumper of \$element is "\, Dumper($element);   print STDERR "Devel​::Peek​::Dump of \$element is "; Devel​::Peek​::Dump $element;   print STDERR "\n";   print STDERR "Keys of \$element are |"\, join("| |"\, keys %{$element})\, "|\n";   print STDERR "Values of \$element are |"\, join("| |"\, values %{$element})\, "|\n";

  my $name = $element->{Name};   printf STDERR "Name is |%s| |%s|\n"\, $name\, $element->{Name};   print STDERR "Dumper of \$name is "\, Dumper($name);   print STDERR "Devel​::Peek​::Dump of \$name is "; Devel​::Peek​::Dump $name;   print STDERR "\n";

- Output ---------------------------------------------------------------- Dumper of $element is $VAR1 = {   'LocalName' => 'hey'\,   'Prefix' => ''\,   'Attributes' => {}\,   'Name' => 'hey'\,   'NamespaceURI' => ''   }; Devel​::Peek​::Dump of $element is SV = RV(0x817f0b0) at 0x82478ec   REFCNT = 1   FLAGS = (PADBUSY\,PADMY\,ROK)   RV = 0x84bb108   SV = PVHV(0x82c2d88) at 0x84bb108   REFCNT = 2   FLAGS = (SHAREKEYS)   IV = 5   NV = 0   ARRAY = 0x82c2120 (0​:4\, 1​:3\, 2​:1)   hash quality = 107.1%   KEYS = 5   FILL = 4   MAX = 7   RITER = -1   EITER = 0x0   Elt "LocalName" HASH = 0x7c3b0f10   SV = PV(0x82b3ec4) at 0x82c1c50   REFCNT = 1   FLAGS = (POK\,pPOK\,UTF8)   PV = 0x82c25c8 "hey"\0 [UTF8 "hey"]   CUR = 3   LEN = 5   Elt "Prefix" HASH = 0x23ee5d8   SV = PV(0x82b3ea0) at 0x82c1c2c   REFCNT = 1   FLAGS = (POK\,pPOK\,UTF8)   PV = 0x82c25b8 ""\0 [UTF8 ""]   CUR = 0   LEN = 2   Elt "Attributes" HASH = 0x507896da   SV = RV(0x817f058) at 0x82c1c98   REFCNT = 1   FLAGS = (ROK)   RV = 0x84bb168   SV = PVHV(0x82c2d28) at 0x84bb168   REFCNT = 1   FLAGS = (SHAREKEYS)   IV = 0   NV = 0   ARRAY = 0x84bee30   KEYS = 0   FILL = 0   MAX = 7   RITER = -1   EITER = 0x0

Keys of $element are |LocalName| |Prefix| |Attributes| |Name| |NamespaceURI| Values of $element are |hey| || |HASH(0x84bb168)| |hey| || Name is || || Dumper of $name is $VAR1 = undef; Devel​::Peek​::Dump of $name is SV = PV(0x82b3ea0) at 0x8249708   REFCNT = 1   FLAGS = (PADBUSY\,PADMY)   PV = 0 ------------------------------------------------------------------------

Perl Info ``` Flags: category=core severity=low Site configuration information for perl v5.8.1: Configured by Debian Project at Tue Sep 30 21:35:53 EST 2003. Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration: Platform: osname=linux, osvers=2.4.22-xfs+ti1211, archname=i386-linux-thread-multi uname='linux kosh 2.4.22-xfs+ti1211 #1 wed sep 24 21:17:59 est 2003 i686 gnulinux ' config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.8.1 -Darchlib=/usr/lib/perl/5.8.1 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.8.1 -Dsitearch=/usr/local/lib/perl/5.8.1 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm -Duseshrplib -Dlibperl=libperl.so.5.8.1 -Dd_dosuid -des' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O3', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='3.3.2 20030908 (Debian prerelease)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt perllibs=-ldl -lm -lpthread -lc -lcrypt libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so.5.8.1 gnulibc_version='2.3.2' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Locally applied patches: @INC for perl v5.8.1: blib/lib /etc/perl /usr/local/lib/perl/5.8.1 /usr/local/share/perl/5.8.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8.1 /usr/share/perl/5.8.1 /usr/local/lib/site_perl /usr/local/lib/perl/5.8.0 /usr/local/share/perl/5.8.0 . Environment for perl v5.8.1: HOME=/home/dave LANG (unset) LANGUAGE (unset) LC_ALL=en_US.ISO-8859-1 LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/dave/scripts:/home/dave/scripts:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin PERL5LIB=blib/lib PERL_BADLANG (unset) SHELL=/bin/bash ```
p5pRT commented 21 years ago

From @andk

On 1 Oct 2003 18​:38​:39 -0000\, "dave@​rudedog.org (via RT)" \perlbug\-followup@​perl\.org said​:

  > I just upgraded to perl 5.8.1 (using Debian/unstable) and it seems to   > have broken XML​::Simple. Basically\, XML​::Simple is creating a hash data   > structure as expected\, but every key and value is empty. After adding   > some diagnostics to the XML​::Simple source\, I found some extreme   > strangeness that looks like a Perl bug.

Would you probably be able to compose a small yet complete perl program that demonstrates the problem?

-- andreas

p5pRT commented 21 years ago

From dave@rudedog.org

On Tue\, Oct 07\, 2003 at 01​:05​:08PM -0000\, Andreas Koenig wrote​:

On 1 Oct 2003 18​:38​:39 -0000\, "dave@​rudedog.org (via RT)" \perlbug\-followup@​perl\.org said​:

I just upgraded to perl 5.8.1 (using Debian/unstable) and it seems to have broken XML​::Simple. Basically\, XML​::Simple is creating a hash data structure as expected\, but every key and value is empty. After adding some diagnostics to the XML​::Simple source\, I found some extreme strangeness that looks like a Perl bug.

Would you probably be able to compose a small yet complete perl program that demonstrates the problem?

Actually\, I've done some more checking into it\, and I suspect that the problem is caused because Debian's perl install has subtly broken ABI compatibility between 5.8.0 and 5.8.1. Recompiling XML​::LibXML against 5.8.1 corrected the problem for me. At this time\, I think it's likely a bug with Debian\, not with Perl.

-- Dave Carrigan Seattle\, WA\, USA dave@​rudedog.org | http​://www.rudedog.org/ | ICQ​:161669680 UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++-DNS-PalmOS-PostgreSQL-MySQL

Dave is currently listening to Cramps - Greenfuz (Psychedelic Jungle)

p5pRT commented 16 years ago

p5p@spam.wizbit.be - Status changed from 'open' to 'resolved'