K
kj
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
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