Skip Menu |

This queue is for tickets about the List-MoreUtils CPAN distribution.

Report information
The Basics
Id: 47842
Status: resolved
Priority: 0/
Queue: List-MoreUtils

People
Owner: Nobody in particular
Requestors: david [...] davidfavor.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: List::MoreUtils-0.23 fails 2128 tests
Date: Mon, 13 Jul 2009 14:23:39 -0500
To: bug-List-MoreUtils [...] rt.cpan.org
From: David Favor <david [...] davidfavor.com>
net2#PERL_DL_NONLAZY=1 /runtime/perl-5.10.0-1572/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/List-MoreUtils.t t/List-MoreUtils.t .. Failed 2128/2173 subtests Test Summary Report ------------------- t/List-MoreUtils.t (Wstat: 11 Tests: 45 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 2173 tests but ran 45. Files=1, Tests=45, 0 wallclock secs ( 0.04 usr 0.00 sys + 0.12 cusr 0.01 csys = 0.17 CPU) Result: FAIL Failed 1/1 test programs. 0/45 subtests failed. net2#PERL_DL_NONLAZY=1 /runtime/perl-5.10.0-1572/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(1, 'blib/lib', 'blib/arch')" t/List-MoreUtils.t t/List-MoreUtils.t .. 1..2173 # Running under perl version 5.010000 for linux # Current time local: Mon Jul 13 14:20:20 2009 # Current time GMT: Mon Jul 13 19:20:20 2009 # Using Test.pm version 1.25_02 ok 1 ok 2 ok 3 ok 4 ok 5 ok 6 ok 7 ok 8 ok 9 ok 10 ok 11 ok 12 ok 13 ok 14 ok 15 ok 16 ok 17 ok 18 ok 19 ok 20 ok 21 ok 22 ok 23 ok 24 ok 25 ok 26 ok 27 ok 28 ok 29 ok 30 ok 31 ok 32 ok 33 ok 34 ok 35 ok 36 ok 37 ok 38 ok 39 ok 40 ok 41 ok 42 ok 43 ok 44 ok 45 Failed 2128/2173 subtests Test Summary Report ------------------- t/List-MoreUtils.t (Wstat: 11 Tests: 45 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 2173 tests but ran 45. Files=1, Tests=45, 1 wallclock secs ( 0.04 usr 0.01 sys + 0.12 cusr 0.01 csys = 0.18 CPU) Result: FAIL Failed 1/1 test programs. 0/45 subtests failed. Show quoted text
_______ net2#perl -V Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Commit id: e6a79cbbfdae09502004811a43d5005c482e3b25 Platform: osname=linux, osvers=2.6.27.21-170.2.56.fc10.i686, archname=i686-linux-thread-multi uname='linux net2.coolsurf.com 2.6.27.21-170.2.56.fc10.i686 #1 smp mon mar 23 23:37:54 edt 2009 i686 i686 i386 gnulinux ' config_args='-Dprefix=/runtime/perl-5.10.0-1572 -ders -Dusedevel -Dcf_by=David Favor -Dcf_email=david@davidfavor.com -Dperladmin=david@davidfavor.com -Dcc=gcc -Doptimize=-O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -m32 -fstack-protector -mtune=generic -Dloclibpth=/usr/local/lib -Dlocincpth=/usr/local/include -Duseshrplib -Dusethreads -Uuseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Dotherlibdirs=/runtime/pmlib:/common/pmlib:/usr/local/pmlib -Ui_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto' hint=recommended, useposix=true, d_sigaction=define 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 -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -m32 -fstack-protector -mtune=generic ', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.3.2 20081105 (Red Hat 4.3.2-7)', 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='gcc', ldflags =' -fstack-protector -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.9.so, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.9' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/runtime/perl-5.10.0-1572/lib/5.10.0/i686-linux-thread-multi/CORE' cccdlflags='-fPIC', lddlflags='-shared -O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -m32 -fstack-protector -mtune=generic -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_USE_DEVEL USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Jul 13 2009 11:30:17 @INC: /runtime/perl-5.10.0-1572/lib/5.10.0/i686-linux-thread-multi /runtime/perl-5.10.0-1572/lib/5.10.0 /runtime/perl-5.10.0-1572/lib/site_perl/5.10.0/i686-linux-thread-multi /runtime/perl-5.10.0-1572/lib/site_perl/5.10.0 /runtime/pmlib /common/pmlib /usr/local/pmlib . -- Love feeling your best ever, all day, every day? Click http://RadicalHealth.com/join for the easy way.
Very similar here - the t/List-MoreUtils.t bombs out with a segmentation fault after "ok 45". This was observed on Solaris 10 Sparc and x86, and RedHat Enterprise Linux 3.0 with perl-5.8.8 - details see below. -Marek Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=linux, osvers=2.4.21-50.elsmp, archname=i686-linux uname='linux kiew079 2.4.21-50.elsmp #1 smp tue may 8 17:18:29 edt 2007 i686 i686 i386 gnulinux ' config_args='-Dprefix=/opt/perl_5.8.8 -Dmydomain=.muc.infineon.com -Dcf_email=perl@muc.infineon.com -Uinstallusrbinperl -Dperlpath=/opt/perl_5.8.8/bin/perl -Dinstallman1dir=/opt/perl_5.8.8/man/man1 -Dman1dir=/opt/perl_5.8.8/man/man1 -Dinstallman3dir=/opt/perl_5.8.8/man/man3 -Dman3dir=/opt/perl_5.8.8/man/man3 -Dperladmin=perl@muc.infineon.com -Dprivlib=/opt/perl_5.8.8/lib -Darchlib=/opt/perl_5.8.8/lib -Dsitelib=/opt/perl_5.8.8/lib -Dsitearch=/opt/perl_5.8.8/lib -Dscriptdir=/opt/perl_5.8.8/bin -Dsitescript=/opt/perl_5.8.8/bin -Ubincompat5005 -Dlibperl=libperlifx.so -Dcc=gcc -Dldflags=-Wl,-rpath,/opt/perl_5.8.8/ext/lib -Dbin=/opt/perl_5.8.8/bin -Dbinexp=/opt/perl_5.8.8/bin -Dsitebin=/opt/perl_5.8.8/bin -Dlocincpth=/opt/perl_5.8.8/ext/include -Dloclibpth=/opt/perl_5.8.8/ext/lib -Dglibpth=/usr/lib /lib -Duseshrplib -Uusethreads -Dpager=/usr/bin/less -Dsed=/bin/sed -Doptimize=-O2 -march=pentium4 -Dlddlflags=-shared -Wl,-rpath,/opt/perl_5.8.8/ext/lib -de' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-m32 -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/opt/perl_5.8.8/ext/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-O2 -march=pentium4', cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/opt/perl_5.8.8/ext/include -I/usr/include/gdbm' ccversion='', gccversion='4.1.2', 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='gcc', ldflags ='-m32 -Wl,-rpath,/opt/perl_5.8.8/ext/lib -L/opt/perl_5.8.8/ext/lib' libpth=/opt/perl_5.8.8/ext/lib /usr/lib /lib libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperlifx.so gnulibc_version='2.3.2' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/opt/perl_5.8.8/lib/CORE' cccdlflags='-fpic', lddlflags='-m32 -shared -Wl,-rpath,/opt/perl_5.8.8/ext/lib -L/opt/perl_5.8.8/ext/lib' Characteristics of this binary (from libperl): Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO Built under linux Compiled at Jul 4 2007 09:11:08 @INC: /opt/perl_5.8.8/lib .
RT-Send-CC: robin.houston [...] gmail.com
I find that a minimal test case is perl -Mblib -MList::MoreUtils=apply -lwe 'my @list = (0 .. 4); my @list1 = apply { $_++ } @list; print foreach @list1' I can fix it like this: --- MoreUtils.xs.orig 2009-07-12 22:40:57.000000000 +0100 +++ MoreUtils.xs 2009-07-14 15:44:08.000000000 +0100 @@ -628,15 +628,14 @@ cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); SAVESPTR(GvSV(PL_defgv)); for(i = 1 ; i < items ; ++i) { GvSV(PL_defgv) = newSVsv(args[i]); MULTICALL; - args = &PL_stack_base[ax]; args[i-1] = GvSV(PL_defgv); } POP_MULTICALL; done: XSRETURN(items-1); } What seems to be going wrong is that PL_stack_base is being changed by the code invoked inside PUSH_MULTICALL(cv). That it could change isn't completely surprising. What is more surprising is that this is the first bug it seems to have triggered. Hence I assume that that line, re-assigning to args, is wrong. (Cc to Robin in case he can shed some light on this) apply seems to be the only XS code that has this construction in. Also, shouldn't the newSVsv(...) be made into a mortal? Right now, to me, it looks like a non-mortal is being pushed onto the stack, meaning that each iteration round that loop will be creating a scalar that leaks. (Well, until global destruction)
Subject: Re: [rt.cpan.org #47842] List::MoreUtils-0.23 fails 2128 tests
Date: Tue, 14 Jul 2009 12:01:05 -0400
To: bug-List-MoreUtils [...] rt.cpan.org
From: Tassilo von Parseval <vparseval [...] gmail.com>
On Tue, Jul 14, 2009 at 10:59 AM, Nicholas Clark via RT<bug-List-MoreUtils@rt.cpan.org> wrote: Show quoted text
>       Queue: List-MoreUtils >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=47842 > > > I find that a minimal test case is > perl -Mblib -MList::MoreUtils=apply -lwe 'my @list  = (0 .. 4); my > @list1 = apply { $_++ } @list; print foreach @list1' > > I can fix it like this: > > --- MoreUtils.xs.orig   2009-07-12 22:40:57.000000000 +0100 > +++ MoreUtils.xs        2009-07-14 15:44:08.000000000 +0100 > @@ -628,15 +628,14 @@ >     cv = sv_2cv(code, &stash, &gv, 0); >     PUSH_MULTICALL(cv); >     SAVESPTR(GvSV(PL_defgv)); > >     for(i = 1 ; i < items ; ++i) { >        GvSV(PL_defgv) = newSVsv(args[i]); >        MULTICALL; > -        args = &PL_stack_base[ax]; >        args[i-1] = GvSV(PL_defgv); >     } >     POP_MULTICALL; > >     done: >     XSRETURN(items-1); >  }
Unfortunately the line that you removed happens to be the fix for https://rt.cpan.org/Ticket/Display.html?id=38630 as submitted by the requestor. :-) I may have to go back to the drawing board here. Show quoted text
> What seems to be going wrong is that PL_stack_base is being changed by > the code invoked inside PUSH_MULTICALL(cv). That it could change isn't > completely surprising. What is more surprising is that this is the first > bug it seems to have triggered. Hence I assume that that line, > re-assigning to args, is wrong. (Cc to Robin in case he can shed some > light on this) > > apply seems to be the only XS code that has this construction in. > > Also, shouldn't the newSVsv(...) be made into a mortal? Right now, to > me, it looks like a non-mortal is being pushed onto the stack, meaning > that each iteration round that loop will be creating a scalar that > leaks. (Well, until global destruction)
Hard to say. I will have to look at the memory consumption more closely by running it under valgrind. At this point, I don't recall apply being leaky. Then again, I don't recall it segfaulting on the test-suite either. ;-) Cheers, Tassilo
Subject: [PATCH] List::MoreUtils-0.23 fails 2128 tests
From: chip [...] pobox.com
On Mon Jul 13 15:24:04 2009, david@davidfavor.com wrote: Show quoted text
> net2#PERL_DL_NONLAZY=1 /runtime/perl-5.10.0-1572/bin/perl "- > MExtUtils::Command::MM" "-e" > "test_harness(0, 'blib/lib', 'blib/arch')" t/List-MoreUtils.t > t/List-MoreUtils.t .. Failed 2128/2173 subtests
The attached patch fixes this for me. It involves making a copy of the argument portion of the stack. There may be a way to grab it from the CX stack intead, but that might be slower in the long term. There is also a remaining memory leak in the code, but it seems unrelated.
--- MoreUtils.xs.orig 2009-07-12 14:40:57.000000000 -0700 +++ MoreUtils.xs 2009-07-14 17:31:31.000000000 -0700 @@ -156,4 +156,14 @@ #define FUNC_NAME GvNAME(GvEGV(ST(items))) +#define COPY_ARGS \ + Newx(args, items+1, SV*); \ + Copy(&ST(0), args, items+1, SV*); \ + SAVEFREEPV(args); + +#define CLAWBACK_ARGS \ + EXTEND(SP, items+1); \ + Copy(args, &ST(0), items+1, SV*); + + inline static int in_pad (const char *name, SV *code) { @@ -201,5 +211,5 @@ for (i = 0; i < items; i++) { \ if (!SvROK(ST(i))) \ - croak("Arguments to %s must be references", FUNC_NAME); \ + croak("Arguments to %s must be references", FUNC_NAME); \ args->avs[i] = (AV*)SvRV(ST(i)); \ SvREFCNT_inc(args->avs[i]); \ @@ -258,5 +268,5 @@ HV *stash; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -264,4 +274,5 @@ XSRETURN_UNDEF; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -291,5 +302,5 @@ GV *gv; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -297,4 +308,5 @@ XSRETURN_UNDEF; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -325,5 +337,5 @@ GV *gv; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -331,4 +343,5 @@ XSRETURN_YES; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -358,5 +371,5 @@ GV *gv; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -364,4 +377,5 @@ XSRETURN_UNDEF; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -392,5 +406,5 @@ I32 gimme = G_SCALAR; I32 count = 0; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -398,4 +412,5 @@ goto done; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -428,5 +443,5 @@ I32 gimme = G_SCALAR; I32 count = 0; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -434,4 +449,5 @@ goto done; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -463,5 +479,5 @@ GV *gv; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -469,4 +485,5 @@ if (items > 1) { + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -498,5 +515,5 @@ GV *gv; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -504,4 +521,5 @@ if (items > 1) { + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -620,5 +638,5 @@ I32 gimme = G_SCALAR; CV *cv; - SV **args = &PL_stack_base[ax]; + SV **args; I32 count = 0; @@ -626,4 +644,5 @@ XSRETURN_EMPTY; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -633,8 +652,8 @@ GvSV(PL_defgv) = newSVsv(args[i]); MULTICALL; - args = &PL_stack_base[ax]; args[i-1] = GvSV(PL_defgv); } POP_MULTICALL; + CLAWBACK_ARGS; done: @@ -654,9 +673,10 @@ GV *gv; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; if (items <= 1) XSRETURN_EMPTY; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -674,5 +694,5 @@ for (j = i + 1; j < items; ++j) - args[j-i-1] = args[j]; + ST(j-i-1) = args[j]; XSRETURN(items-i-1); @@ -691,9 +711,10 @@ GV *gv; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; if (items <= 1) XSRETURN_EMPTY; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -711,5 +732,5 @@ for (j = i; j < items; j++) - args[j-i] = args[j]; + ST(j-i) = args[j]; XSRETURN(items-i); @@ -727,5 +748,5 @@ GV *gv; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -733,4 +754,5 @@ XSRETURN_EMPTY; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -747,4 +769,5 @@ POP_MULTICALL; + CLAWBACK_ARGS; XSRETURN(i-1); @@ -762,5 +785,5 @@ GV *gv; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -768,4 +791,5 @@ XSRETURN_EMPTY; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -783,4 +807,5 @@ POP_MULTICALL; + CLAWBACK_ARGS; XSRETURN(i-1); @@ -798,5 +823,5 @@ GV *gv; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -804,4 +829,5 @@ XSRETURN_EMPTY; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -820,5 +846,5 @@ for (i = 0; i < j; ++i) - sv_2mortal(args[i]); + ST(i) = sv_2mortal(args[i]); XSRETURN(j); @@ -836,5 +862,5 @@ GV *gv; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -842,4 +868,5 @@ if (items > 1) { + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -872,5 +899,5 @@ GV *gv; I32 gimme = G_SCALAR; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -878,4 +905,5 @@ if (items > 1) { + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -1324,5 +1352,5 @@ I32 gimme = G_SCALAR; I32 count = 0; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -1333,4 +1361,5 @@ XSRETURN_EMPTY; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -1394,5 +1423,5 @@ I32 gimme = G_SCALAR; I32 count = 0; - SV **args = &PL_stack_base[ax]; + SV **args; CV *cv; @@ -1402,4 +1431,5 @@ XSRETURN_EMPTY; + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -1450,5 +1480,5 @@ HV *stash; GV *gv; - SV **args = &PL_stack_base[ax+1]; + SV **args; CV *cv; I32 gimme = GIMME; /* perl-5.5.4 bus-errors out later when using GIMME @@ -1460,4 +1490,5 @@ if (items > 1) { + COPY_ARGS; cv = sv_2cv(code, &stash, &gv, 0); PUSH_MULTICALL(cv); @@ -1472,5 +1503,5 @@ break; - GvSV(PL_defgv) = args[k]; + GvSV(PL_defgv) = (args+1)[k]; MULTICALL; val = SvIV(*PL_stack_sp); @@ -1480,5 +1511,5 @@ if (gimme == G_SCALAR) XSRETURN_YES; - SvREFCNT_inc(RETVAL = args[k]); + SvREFCNT_inc(RETVAL = (args+1)[k]); goto yes; }
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #47842] [PATCH] List::MoreUtils-0.23 fails 2128 tests
Date: Sat, 18 Jul 2009 08:02:32 -0400
To: Chip Salzenberg via RT <bug-List-MoreUtils [...] rt.cpan.org>
From: Tassilo von Parseval <vparseval [...] gmail.com>
On Tue, Jul 14, 2009 at 09:11:56PM -0400, Chip Salzenberg via RT wrote: Show quoted text
> Queue: List-MoreUtils > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=47842 > > > On Mon Jul 13 15:24:04 2009, david@davidfavor.com wrote:
> > net2#PERL_DL_NONLAZY=1 /runtime/perl-5.10.0-1572/bin/perl "- > > MExtUtils::Command::MM" "-e" > > "test_harness(0, 'blib/lib', 'blib/arch')" t/List-MoreUtils.t > > t/List-MoreUtils.t .. Failed 2128/2173 subtests
> > The attached patch fixes this for me. It involves making a copy of the > argument portion of the stack. There may be a way to grab it from the > CX stack intead, but that might be slower in the long term.
I'd rather avoid making a copy of the whole stack, even when it's just a shallow one. It's obvious that this construct: SV **args = &PL_stack_base[ax]; ... for (...) { args[i-1] = some_assignment; } will fall all over itself once perl grows the stack and the address of PL_stack_base changes. Therefore, I think I can simply replace above code with: for (...) { PL_stack_base[ax+i-1] = some_assignement; } Thus, I'd be using the authoritative stack pointer directly and thus I should be immune to any goofy reallocking going on. Does anybody see any flaws in this? With this, all my tests pass. Cheers, Tassilo -- $_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({ pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#; $_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
On Sa. 18. Jul. 2009, 08:02:55, vparseval@gmail.com wrote: Show quoted text
> On Tue, Jul 14, 2009 at 09:11:56PM -0400, Chip Salzenberg via RT wrote:
> > Queue: List-MoreUtils > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=47842 > > > > > On Mon Jul 13 15:24:04 2009, david@davidfavor.com wrote:
> > > net2#PERL_DL_NONLAZY=1 /runtime/perl-5.10.0-1572/bin/perl "- > > > MExtUtils::Command::MM" "-e" > > > "test_harness(0, 'blib/lib', 'blib/arch')" t/List-MoreUtils.t > > > t/List-MoreUtils.t .. Failed 2128/2173 subtests
> > > > The attached patch fixes this for me. It involves making a copy of the > > argument portion of the stack. There may be a way to grab it from the > > CX stack intead, but that might be slower in the long term.
> > I'd rather avoid making a copy of the whole stack, even when it's just a > shallow one. It's obvious that this construct: > > SV **args = &PL_stack_base[ax]; > ... > for (...) { > args[i-1] = some_assignment; > } > > will fall all over itself once perl grows the stack and the address of > PL_stack_base changes. Therefore, I think I can simply replace above > code with: > > for (...) { > PL_stack_base[ax+i-1] = some_assignement; > } > > Thus, I'd be using the authoritative stack pointer directly and thus I > should be immune to any goofy reallocking going on. > > Does anybody see any flaws in this? With this, all my tests pass. > > Cheers, > Tassilo
I don't know if the last comment made it into L:MU but with perl-5.8.8 here the new version 0.24 still fails: $ perl -Mblib t/List-MoreUtils.t 1..2173 # Running under perl version 5.008008 for linux # Current time local: Mon Jul 27 14:18:52 2009 # Current time GMT: Mon Jul 27 12:18:52 2009 # Using Test.pm version 1.25 Segmentation fault HTH, Marek
Subject: Re: [rt.cpan.org #47842] List::MoreUtils-0.23 fails 2128 tests
Date: Mon, 27 Jul 2009 08:18:08 -0500
To: bug-List-MoreUtils [...] rt.cpan.org
From: David Favor <david [...] davidfavor.com>
Marek Rouchal via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=47842 > > > On Sa. 18. Jul. 2009, 08:02:55, vparseval@gmail.com wrote:
>> On Tue, Jul 14, 2009 at 09:11:56PM -0400, Chip Salzenberg via RT wrote:
>>> Queue: List-MoreUtils >>> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=47842 > >>> >>> On Mon Jul 13 15:24:04 2009, david@davidfavor.com wrote:
>>>> net2#PERL_DL_NONLAZY=1 /runtime/perl-5.10.0-1572/bin/perl "- >>>> MExtUtils::Command::MM" "-e" >>>> "test_harness(0, 'blib/lib', 'blib/arch')" t/List-MoreUtils.t >>>> t/List-MoreUtils.t .. Failed 2128/2173 subtests
>>> The attached patch fixes this for me. It involves making a copy of the >>> argument portion of the stack. There may be a way to grab it from the >>> CX stack intead, but that might be slower in the long term.
>> I'd rather avoid making a copy of the whole stack, even when it's just a >> shallow one. It's obvious that this construct: >> >> SV **args = &PL_stack_base[ax]; >> ... >> for (...) { >> args[i-1] = some_assignment; >> } >> >> will fall all over itself once perl grows the stack and the address of >> PL_stack_base changes. Therefore, I think I can simply replace above >> code with: >> >> for (...) { >> PL_stack_base[ax+i-1] = some_assignement; >> } >> >> Thus, I'd be using the authoritative stack pointer directly and thus I >> should be immune to any goofy reallocking going on. >> >> Does anybody see any flaws in this? With this, all my tests pass. >> >> Cheers, >> Tassilo
> > > I don't know if the last comment made it into L:MU but with perl-5.8.8 > here the new version 0.24 still fails: > > $ perl -Mblib t/List-MoreUtils.t > 1..2173 > # Running under perl version 5.008008 for linux > # Current time local: Mon Jul 27 14:18:52 2009 > # Current time GMT: Mon Jul 27 12:18:52 2009 > # Using Test.pm version 1.25 > Segmentation fault > > HTH, > Marek
I just opened a bug for List::Moreutils-0.24 on latest perl maint. There seems to be some mismatch between operators for numeric and alphanumeric tests in the case I opened. -- Love feeling your best ever, all day, every day? Click http://RadicalHealth.com/join for the easy way.
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #47842] List::MoreUtils-0.23 fails 2128 tests
Date: Tue, 28 Jul 2009 16:16:01 -0400
To: Marek Rouchal via RT <bug-List-MoreUtils [...] rt.cpan.org>
From: Tassilo von Parseval <vparseval [...] gmail.com>
On Mon, Jul 27, 2009 at 08:20:31AM -0400, Marek Rouchal via RT wrote: Show quoted text
> Queue: List-MoreUtils > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=47842 > > > On Sa. 18. Jul. 2009, 08:02:55, vparseval@gmail.com wrote:
> > On Tue, Jul 14, 2009 at 09:11:56PM -0400, Chip Salzenberg via RT wrote:
> > > Queue: List-MoreUtils > > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=47842 > > > > > > > On Mon Jul 13 15:24:04 2009, david@davidfavor.com wrote:
> > > > net2#PERL_DL_NONLAZY=1 /runtime/perl-5.10.0-1572/bin/perl "- > > > > MExtUtils::Command::MM" "-e" > > > > "test_harness(0, 'blib/lib', 'blib/arch')" t/List-MoreUtils.t > > > > t/List-MoreUtils.t .. Failed 2128/2173 subtests
> > > > > > The attached patch fixes this for me. It involves making a copy of the > > > argument portion of the stack. There may be a way to grab it from the > > > CX stack intead, but that might be slower in the long term.
> > > > I'd rather avoid making a copy of the whole stack, even when it's just a > > shallow one. It's obvious that this construct: > > > > SV **args = &PL_stack_base[ax]; > > ... > > for (...) { > > args[i-1] = some_assignment; > > } > > > > will fall all over itself once perl grows the stack and the address of > > PL_stack_base changes. Therefore, I think I can simply replace above > > code with: > > > > for (...) { > > PL_stack_base[ax+i-1] = some_assignement; > > } > > > > Thus, I'd be using the authoritative stack pointer directly and thus I > > should be immune to any goofy reallocking going on. > > > > Does anybody see any flaws in this? With this, all my tests pass.
> > I don't know if the last comment made it into L:MU but with perl-5.8.8 > here the new version 0.24 still fails:
It made it and it is the culprit for those failures on 5.8.8. I guess that did answer my question quite convincingly. ;-) Cheers, Tassilo -- $_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({ pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#; $_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
See the other RT ticket - I can confirm that 0.25_2 works OK here with perl-5.8.8 on Solaris and Linux. But there is another RT regarding a memory leak... HTH, Marek
Closing this ticket, as the test suite now passes 100% and the individual issues discussed all have their own tickets.