develooper Front page | perl.perl5.porters | Postings from May 2004

Re: Util::Scalar::weaken has changed in 5.8.4?

Thread Previous | Thread Next
From:
Stas Bekman
Date:
May 4, 2004 12:31
Subject:
Re: Util::Scalar::weaken has changed in 5.8.4?
Message ID:
4097EF6F.8050401@stason.org
Further investigation shows the following:

Util::Scalar::weaken has this problem only with 5.8.2 and 5.8.4. It works fine 
with 5.8.0, 5.8.1, 5.8.3 and blead (all ithreads enabled).

The cool thing is that with blead it not only works, it doesn't produce any 
warnings. That means that some fixes weren't propogated back to maint, and 
even worse it did work fine with 5.8.3.

What are the chances that Example::CLONE will be integrated into the perl test 
suite? It is a tiny perl/XS module that tests core perl functionality: 
http://perl.apache.org/~stas/Example-CLONE-0.02.tar.gz

Nick, please try to run that module with:

perl-5.8.2-ithread Makefile.PL && make test  # hangs
perl-5.8.3-ithread Makefile.PL && make test  # works + warnings
perl-5.8.4-ithread Makefile.PL && make test  # hangs
perl-blead-ithread Makefile.PL && make test  # works + no warnings!


Stas Bekman wrote:
> Has something changed in Util::Scalar::weaken since 5.8.3? I get:
> 
> Usage: Scalar::Util::weaken(sv) at t/threads.t line 34.
> 
> on a perfectly fine RV:
> 
> SV = RV(0x81ae418) at 0x81f584c
>   REFCNT = 1
>   FLAGS = (PADBUSY,PADMY,ROK)
>   RV = 0x8227528
>   SV = PVMG(0x821a458) at 0x8227528
>     REFCNT = 3
>     FLAGS = (OBJECT,IOK,POK,pIOK,pPOK)
>     IV = 136751752
>     NV = 0
>     PV = 0x81f6bb8 "136751752"\0
>     CUR = 9
>     LEN = 10
>     STASH = 0x8227534   "Example::CLONE"
> 
> cd Example-CLONE-0.02
> perl-5.8.4-ithread Makefile.PL
> make test
> t/basic......ok
> t/threads....ok 5/17
> Usage: Scalar::Util::weaken(sv) at t/threads.t line 34.
> # Looks like you planned 17 tests but only ran 5.
> # Looks like your test died just after 5.
> 
> It fails in:
> 
>   threads->new(\&read_test) for 1..$threads;
> 
> when it invokes Example::CLONE::CLONE:
> 
>   Scalar::Util::weaken($objects{"$$self"});
> 
> which is what the Dump of you see above.
> 
> Example-CLONE is a tiny module that I wrote to demonstrate what is the 
> CLONE function for but never ended on CPAN since Perl still has too many 
> problems with threads. Available from 
> http://perl.apache.org/~stas/Example-CLONE-0.02.tar.gz
> 
> it works fine with 5.8.3 (with regards to Scalar::Util::weaken).
> 
> perl-5.8.4-ithread -V
> Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
>   Platform:
>     osname=linux, osvers=2.6.3-7mdk, archname=i686-linux-thread-multi
>     uname='linux rabbit.stason.org 2.6.3-7mdk #1 wed mar 17 15:56:42 cet 
> 2004 i686 unknown unknown gnulinux '
>     config_args='-des -Dprefix=/home/stas/perl/5.8.4-ithread 
> -Dusethreads -Doptimize=-g -Duseshrplib -Dusedevel 
> -Accflags=-DDEBUG_LEAKING_SCALARS'
>     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 
> -DDEBUG_LEAKING_SCALARS -DDEBUGGING -fno-strict-aliasing 
> -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
> -I/usr/include/gdbm',
>     optimize='-g',
>     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
> -DDEBUG_LEAKING_SCALARS -DDEBUGGING -fno-strict-aliasing 
> -I/usr/local/include -I/usr/include/gdbm'
>     ccversion='', gccversion='3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)', 
> 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 =' -L/usr/local/lib'
>     libpth=/usr/local/lib /lib /usr/lib
>     libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
>     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
>     libc=/lib/libc-2.3.3.so, so=so, useshrplib=true, libperl=libperl.so
>     gnulibc_version='2.3.3'
>   Dynamic Linking:
>     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E 
> -Wl,-rpath,/home/stas/perl/5.8.4-ithread/lib/5.8.4/i686-linux-thread-multi/CORE' 
> 
>     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
> 
> 
> Characteristics of this binary (from libperl):
>   Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS 
> USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
>   Locally applied patches:
>         RC2
>   Built under linux
>   Compiled at Apr 20 2004 18:06:53
>   %ENV:
>     PERLDOC_PAGER="less -R"
>   @INC:
>     /home/stas/perl/5.8.4-ithread/lib/5.8.4/i686-linux-thread-multi
>     /home/stas/perl/5.8.4-ithread/lib/5.8.4
>     
> /home/stas/perl/5.8.4-ithread/lib/site_perl/5.8.4/i686-linux-thread-multi
>     /home/stas/perl/5.8.4-ithread/lib/site_perl/5.8.4
>     /home/stas/perl/5.8.4-ithread/lib/site_perl
>     .
> 
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About