Thanks.
Known problem with early versions of perl 5.8.x
Apply the attached patch.

Tim.


On Mon, Sep 04, 2006 at 04:32:31PM +0200, Tom Naets wrote:
> Hello,
> 
> I've just downloaded DBI version 1.52 from CPAN. I am getting some failures
> when running 'make test':
> 
> t/zvpp_72childhandles....NOK 3#     Failed test (t/72childhandles.t at line
> 43)
> #          got: '0'
> #     expected: '10'
> t/zvpp_72childhandles....NOK 4#     Failed test (t/72childhandles.t at line
> 50)
> #          got: '0'
> #     expected: '10'
> t/zvpp_72childhandles....NOK 7#     Failed test (t/72childhandles.t at line
> 76)
> #          got: '0'
> #     expected: '200'
> Use of uninitialized value in print at t/72childhandles.t line 89.
> Use of uninitialized value in print at t/72childhandles.t line 89.
> Use of uninitialized value in print at t/72childhandles.t line 89.
> Use of uninitialized value in print at t/72childhandles.t line 89.
> t/zvpp_72childhandles....NOK 8#     Failed test (t/72childhandles.t at line
> 91)
> #          got: '1'
> #     expected: '202'
> t/zvpp_72childhandles....NOK 10#     Failed test (t/72childhandles.t at line
> 93)
> #                   undef
> #     doesn't match '(?-xism:^dbh)'
> t/zvpp_72childhandles....NOK 11#     Failed test (t/72childhandles.t at line
> 94)
> #                   undef
> #     doesn't match '(?-xism:^sth)'
> t/zvpp_72childhandles....ok 14/14# Looks like you failed 6 tests of 14.
> t/zvpp_72childhandles....dubious
>        Test returned status 6 (wstat 1536, 0x600)
> DIED. FAILED tests 3-4, 7-8, 10-11
>        Failed 6/14 tests, 57.14% okay
> 
> 
> I've checked this out and it seems the problem is caused by $HAS_WEAKEN not
> being properly set in DBI/PurePerl.pm. The system I'm trying to install on
> is a Solaris 8. I've also tested it on a linux system and noticed some
> changes in the Scalar::Util::weaken behavior. This is what I get when I run
> the code from DBI/PurePerl:
> 
> On Solaris 8:
> 
> [EMAIL PROTECTED] DBI-1.52]# uname -a
> SunOS hobbes 5.8 Generic_117350-04 sun4u sparc SUNW,UltraAX-i2
> [EMAIL PROTECTED] DBI-1.52]# perl -MScalar::Util
> Scalar::Util::weaken(my $test = \"foo");
> Modification of a read-only value attempted at - line 1.
> 
> On CentOS Linux it works fine:
> 
> [EMAIL PROTECTED] ~]# uname -a
> Linux burns 2.6.9-34.EL #1 Wed Mar 8 00:07:35 CST 2006 i686 i686 i386
> GNU/Linux
> [EMAIL PROTECTED] ~]# perl -MScalar::Util
> Scalar::Util::weaken(my $test = \"foo");
> [EMAIL PROTECTED] ~]#
> 
> The Scalar::Util version on my Solaris system is 1.13. Here is the
> information about my perl executable on the Solaris:
> 
> Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
>  Platform:
>    osname=solaris, osvers=2.8, archname=sun4-solaris-thread-multi
>    uname='sunos takeoff 5.8 generic_108528-23 sun4u sparc
> sunw,ultrasparc-iii-cengine '
>    config_args='-Dusethreads -Duseithreads -Dcc=gcc -Dprefix=/usr/local
> -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='gcc', ccflags ='-D_REENTRANT -fno-strict-aliasing
> -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
>    optimize='-O',
>    cppflags='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include'
>    ccversion='', gccversion='3.3', gccosandvers='solaris2.8'
>    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
>    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
>    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
> lseeksize=8
>    alignbytes=8, prototype=define
>  Linker and Libraries:
>    ld='gcc', ldflags =' -L/usr/local/lib '
>    libpth=/usr/local/lib /usr/lib /usr/ccs/lib
>    libs=-lsocket -lnsl -lgdbm -ldl -lm -lpthread -lc
>    perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc
>    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
>    gnulibc_version=''
>  Dynamic Linking:
>    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
>    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'
> 
> 
> Characteristics of this binary (from libperl):
>  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
> PERL_IMPLICIT_CONTEXT
>  Built under solaris
>  Compiled at Nov 20 2003 17:03:13
>  %ENV:
>    PERL5LIB=":/var/tmp/MyPerlModules"
>  @INC:
>    /var/tmp/MyPerlModules
>    /usr/local/lib/perl5/5.8.2/sun4-solaris-thread-multi
>    /usr/local/lib/perl5/5.8.2
>    /usr/local/lib/perl5/site_perl/5.8.2/sun4-solaris-thread-multi
>    /usr/local/lib/perl5/site_perl/5.8.2
>    /usr/local/lib/perl5/site_perl
>    .
> 
> Grtz,
> 
> Tom
Author: timbo
Date: Mon Sep  4 06:40:38 2006
New Revision: 6843

Modified:
   dbi/trunk/Changes
   dbi/trunk/lib/DBI/PurePerl.pm
   dbi/trunk/t/72childhandles.t

Log:
Fixed checks for weaken to work with early 5.8.x versions


Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes   (original)
+++ dbi/trunk/Changes   Mon Sep  4 06:40:38 2006
@@ -6,6 +6,10 @@
 
 XXX update docs for Profile &subname magic Path elements
 
+=head2 Changes in DBI 1.53 (svn rev XXX),   XXX 2006
+
+  Fixed checks for weaken to work with early 5.8.x versions
+
 =head2 Changes in DBI 1.52 (svn rev 6840),   30th July 2006
 
   Fixed memory leak (per handle) thanks to Nicholas Clark and Ephraim Dan.

Modified: dbi/trunk/lib/DBI/PurePerl.pm
==============================================================================
--- dbi/trunk/lib/DBI/PurePerl.pm       (original)
+++ dbi/trunk/lib/DBI/PurePerl.pm       Mon Sep  4 06:40:38 2006
@@ -42,7 +42,7 @@
 my $HAS_WEAKEN = eval { 
     require Scalar::Util;
     # this will croak() if this Scalar::Util doesn't have a working weaken().
-    Scalar::Util::weaken(my $test = \"foo"); 
+    Scalar::Util::weaken( my $test = [] ); 
     1;
 };
 

Modified: dbi/trunk/t/72childhandles.t
==============================================================================
--- dbi/trunk/t/72childhandles.t        (original)
+++ dbi/trunk/t/72childhandles.t        Mon Sep  4 06:40:38 2006
@@ -13,7 +13,7 @@
 my $HAS_WEAKEN = eval {
     require Scalar::Util;
     # this will croak() if this Scalar::Util doesn't have a working weaken().
-    Scalar::Util::weaken( \my $test ); # same test as in DBI.pm
+    Scalar::Util::weaken( my $test = [] ); # same test as in DBI.pm
     1;
 };
 if (!$HAS_WEAKEN) {

Reply via email to