Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #23004] Bad interaction between XML::Parser and Storable

1 view
Skip to first unread message

Kevin Moore

unread,
Jul 15, 2003, 3:41:04 PM7/15/03
to bugs-bi...@netlabs.develooper.com
# New Ticket Created by Kevin Moore
# Please include the string: [perl #23004]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=23004 >


Below is a demo script which dies under perl 5.8.0, but works fine under
5.6.1. Tested on RedHat 8 & 9 (fails) and RedHat 7.3 (works) on i386
(perl -V output for RedHat 9 at end). The error message is:

Assertion flags == 0 failed: file "Storable.xs", line 2336 at
./bugger.pl line 6.

Here is the script:

---------------------------------------------------
#!/usr/bin/perl -w
use test_bug;
use Storable;
my $a = test_bug->new;
$a->load_dat('<bug><test>0</test></bug>');
my $b = Storable::dclone($a);
---------------------------------------------------


Here is what I've got in the "test_bug.pm" file:

---------------------------------------------------
package test_bug;
use XML::Parser;
return 1;
sub new
{
my $type = shift;
my $class = ref($type) || $type;
my $self = {};
$self->{test} = undef;
return bless $self, $class;
}
sub load_dat
{
my $self = shift;
my $xml_dat = shift;
my $tag;
my $p1 = new XML::Parser(Style => 'Tree');
my $parsed_data = $p1->parse($xml_dat);
shift @{$parsed_data};
$parsed_data = shift @{$parsed_data};
shift @{$parsed_data};
$tag = shift @{$parsed_data};
# $tag now eq 'test', but setting tag to 'test' eliminates error
$self->{$tag} = "anything you want";
}
__END__
--------------------------------------------------

This is about as small as I can make it without eliminating the error;
simplifying the scripts any more (e.g., incorporating test_bug.pm into
bugger.pl) makes the error go away.

Regards,

Kevin Moore


perl -V output (RedHat 9 box):

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=linux, osvers=2.4.20-2.48smp,
archname=i386-linux-thread-multi
uname='linux str'
config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -g
-Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red
Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux
-Dvendorprefix=/usr -Dsiteprefix=/usr
-Dotherlibdirs=/usr/lib/perl5/5.8.0 -Duseshrplib -Dusethreads
-Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db
-Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio
-Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less
-isr'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef'
useithreads=define usemultiplicity=
useperlio= d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=un uselongdouble=
usemymalloc=, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBUGGING -fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING
-fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='3.2.2 20030213 (Red Hat Linux 8.0
3.2.2-1)', gccosandvers=''
gccversion='3.2.2 200302'
intsize=e, longsize= , ptrsize=p, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long'
k', ivsize=4'
ivtype='long'
known_ext, nvtype='double'
o_nonbl', nvsize=, Off_t='', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc'
l', ldflags =' -L/usr/local/lib'
ldf'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
perllibs=
libc=/lib/libc-2.3.1.so, so=so, useshrplib=true, libperl=libper
gnulibc_version='2.3.1'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so', d_dlsymun=undef, ccdlflags='-rdynamic
-Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE'
cccdlflags='-fPIC'
ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5', lddlflags='s
Unicode/Normalize
XS/A'


Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS
USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Locally applied patches:
MAINT18379
Built under linux
Compiled at Feb 18 2003 22:19:53
%ENV:
PERL5LIB="/home/kevin/dloads/perl/lib/perl5/site_perl:"
@INC:

/home/kevin/dloads/perl/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/home/kevin/dloads/perl/lib/perl5/site_perl/5.8.0
/home/kevin/dloads/perl/lib/perl5/site_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
.


Andreas J Koenig

unread,
Jul 16, 2003, 9:20:14 AM7/16/03
to perl5-...@perl.org, nwc...@cpan.org
Kevin Moore (via RT) <perlbug-...@perl.org> writes:

> Below is a demo script which dies under perl 5.8.0, but works fine under
> 5.6.1. Tested on RedHat 8 & 9 (fails) and RedHat 7.3 (works) on i386
> (perl -V output for RedHat 9 at end). The error message is:
>
> Assertion flags == 0 failed: file "Storable.xs", line 2336 at
> ./bugger.pl line 6.

Confirmed on bleadperl. Blame analysis says, it is so since patch 15893.

--
andreas

0 new messages