Closed p5pRT closed 16 years ago
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 ------------------------------------------------------------------------
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
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)
p5p@spam.wizbit.be - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#24084 (status was 'resolved')
Searchable as RT24084$