[26959] in Perl-Users-Digest
Perl-Users Digest, Issue: 8916 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 3 14:05:25 2006
Date: Fri, 3 Feb 2006 11:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 3 Feb 2006 Volume: 10 Number: 8916
Today's topics:
Obscure utf8/"panic: malloc" bug <socyl@987jk.com.invalid>
Re: Recursive chmod/chown <scobloke2@infotop.co.uk>
Re: XML::Simple Parsing with Attributes problem xhoster@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 3 Feb 2006 17:05:02 +0000 (UTC)
From: kj <socyl@987jk.com.invalid>
Subject: Obscure utf8/"panic: malloc" bug
Message-Id: <ds02fu$jl2$1@reader2.panix.com>
I'm trying to find a workaround to bug that is causing me a lot of
problems now. This bug surfaces under very rare conditions, but
they happen to apply to me at the moment.
I've traced the bug to the execution of line 49 of DBD/mysql.pm
(v. 3.0002) (though I'm almost certain that the involvement of
DBD/mysql.pm here is purely coincidental):
if ($dsn =~ /([^:;]*)[:;](.*)/) {
At the time of failure, the $dsn variable contains, as far as I
can tell, the string "host=martdb.ebi.ac.uk;port=3306". If, within
the Perl debugger, I turn on tracing when the program reaches the
line shown above, but right before failure, I see that (somehow),
the code being executed is from the function SWASHNEW in
/usr/lib/perl5/5.8.6/utf8_heavy.pl. The execution of the function
reaches the end, and control returns to line 50 of DBD/mysql.pm,
implying that the match succeeded. This is as expected, except
that if I print $1 and $2 I get nonsense, though this nonsense
changes from one execution to the next. Sometime I get columns of
hex numbers:
DB<1> p $1
1D6C2 1D6DA
1D6DC
DB<2> p $2
D6FA
1D6FC 1D714
1D716 1D734
1D736 1D74E
1D750 1D76E
1D770
...but more typically what I get are strings of gobbledygook (i.e.
the stuff one sees if one tries to print binary data).
BTW, the original string in $dsn appears to be OK:
DB<3> p $dsn
host=martdb.ebi.ac.uk;port=3306
Of course, from this point on all hell breaks lose.
I have tried to come up with a small script that reproduces this
bug, but no avail. The only way I can reproduce this bug involves
having a lot of other big stuff loaded.
I'm at wits' end about this. At this point I'm just looking for
a workaround.
Any suggestions would be appreciated!
FWIW, the system is Linux (SuSE). I gave the output of uname -ar
and perl -V below. (The only thing that looks to me like a potential
problem is the fact that perl was compiled with
archname=i586-linux-thread-multi, but uname -ar does not mention
i586 at all, only i686 and i386. Our sysadmin assures me that this
mismatch should not be a problem, but I'm not entirely convinced.)
kj
% uname -ar
Linux luna 2.6.11.4-21.10-smp #1 SMP Tue Nov 29 14:32:49 UTC 2005 i686 i686 i386 GNU/Linux
% perl -V
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
Platform:
osname=linux, osvers=2.6.9, archname=i586-linux-thread-multi
uname='linux g226 2.6.9 #1 smp tue jun 28 14:58:56 utc 2005 i686 i686 i386 gnulinux '
config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr -Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm -Duseshrplib=true -Doptimize=-O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -g -Wall -pipe'
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 -DDEBUGGING -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -g -Wall -pipe',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe'
ccversion='', gccversion='3.3.5 20050117 (prerelease) (SUSE Linux)', 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 =''
libpth=/lib /usr/lib /usr/local/lib
libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.4'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.6/i586-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Locally applied patches:
SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
Built under linux
Compiled at Dec 17 2005 03:23:29
%ENV:
PERL5LIB="/home/jones/local/lib/perl5"
PERL5_CPANPLUS_CONFIG="/home/jones/.cpanplus/config"
PERL_RL="Perl"
@INC:
/home/jones/local/lib/perl5/5.8.6/i586-linux-thread-multi
/home/jones/local/lib/perl5/5.8.6
/home/jones/local/lib/perl5/i586-linux-thread-multi
/home/jones/local/lib/perl5
/usr/lib/perl5/5.8.6/i586-linux-thread-multi
/usr/lib/perl5/5.8.6
/usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.6
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.6/i586-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.6
/usr/lib/perl5/vendor_perl
.
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
------------------------------
Date: Fri, 3 Feb 2006 16:13:12 +0000 (UTC)
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Recursive chmod/chown
Message-Id: <drvveo$otp$1@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com>
Christopher W Aiken wrote:
> In UNIX a simple "-R" option on the "chmod/chgrp/chown" command
> will traverse all files and directories. Is there a simple way of
> doing this same thing is a Perl script?
>
File::Find ?
------------------------------
Date: 03 Feb 2006 16:39:34 GMT
From: xhoster@gmail.com
Subject: Re: XML::Simple Parsing with Attributes problem
Message-Id: <20060203114119.655$G6@newsreader.com>
"John" <john@heathdrive.com> wrote:
> Hi - problem parsing with an attribute name.
>
> <england>
> <town code="LON">Capital City</town>
> <town code="MAN">Manchester</town>
> <town code="BHAM">Birmingham</town>
> </england>
>
> I'm using XML::Simple.
>
> $xml = new XML::Simple (ForceArray=>1, suppressempty=>1);
> $data = $xml->XMLin($xmlfile);
>
> $which=$data->{england}->[0]->{town}->[0]; doesn't work.
>
> I need to access both attribute value and its contents (BHAM and
> Birmingham).
>
> Any ideas?
use Data::Dumper;
print Dumper $data;
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8916
***************************************