Skip Menu |

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

Report information
The Basics
Id: 101157
Status: resolved
Priority: 0/
Queue: List-Gather

People
Owner: ether [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: Segfaults when running test suite with perl 5.21.7 (List-Gather-0.09)
Starting with perl 5.21.7 there are segfaults when running the test suite (seen on linux and freebsd systems, fail reports will follow on cpantesters). perl 5.21.6 and less looks fine. Test Summary Report ------------------- t/basic.t (Wstat: 11 Tests: 1 Failed: 0) Non-zero wait status: 11 Parse errors: No plan found in TAP output t/context.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: No plan found in TAP output t/errors.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: No plan found in TAP output t/exceptions.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: No plan found in TAP output t/modifier.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: No plan found in TAP output t/return.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: No plan found in TAP output t/syntax.t (Wstat: 11 Tests: 0 Failed: 0) Non-zero wait status: 11 Parse errors: No plan found in TAP output
On Sat Dec 27 15:54:33 2014, SREZIC wrote: Show quoted text
> Starting with perl 5.21.7 there are segfaults when running the test > suite (seen on linux and freebsd systems, fail reports will follow on > cpantesters). perl 5.21.6 and less looks fine. > > Test Summary Report > ------------------- > t/basic.t (Wstat: 11 Tests: 1 Failed: 0) > Non-zero wait status: 11 > Parse errors: No plan found in TAP output > t/context.t (Wstat: 11 Tests: 0 Failed: 0) > Non-zero wait status: 11 > Parse errors: No plan found in TAP output > t/errors.t (Wstat: 11 Tests: 0 Failed: 0) > Non-zero wait status: 11 > Parse errors: No plan found in TAP output > t/exceptions.t (Wstat: 11 Tests: 0 Failed: 0) > Non-zero wait status: 11 > Parse errors: No plan found in TAP output > t/modifier.t (Wstat: 11 Tests: 0 Failed: 0) > Non-zero wait status: 11 > Parse errors: No plan found in TAP output > t/return.t (Wstat: 11 Tests: 0 Failed: 0) > Non-zero wait status: 11 > Parse errors: No plan found in TAP output > t/syntax.t (Wstat: 11 Tests: 0 Failed: 0) > Non-zero wait status: 11 > Parse errors: No plan found in TAP output
Here is a patch. I have only tested it with bleadperl.
Subject: open_QJYSsToU.txt
diff -rup List-Gather-0.09-kNQzAM-orig/Gather.xs List-Gather-0.09-kNQzAM/Gather.xs --- List-Gather-0.09-kNQzAM-orig/Gather.xs 2014-12-27 12:18:08.000000000 -0800 +++ List-Gather-0.09-kNQzAM/Gather.xs 2014-12-27 17:24:14.000000000 -0800 @@ -7,10 +7,17 @@ #define SVt_PADNAME SVt_PVMG #ifndef COP_SEQ_RANGE_LOW_set -# define COP_SEQ_RANGE_LOW_set(sv,val) \ +# ifdef newPADNAMEpvn +# define COP_SEQ_RANGE_LOW_set(sv,val) \ + do { (sv)->xpadn_low = (val); } while (0) +# define COP_SEQ_RANGE_HIGH_set(sv,val) \ + do { (sv)->xpadn_high = (val); } while (0) +# else +# define COP_SEQ_RANGE_LOW_set(sv,val) \ do { ((XPVNV *)SvANY(sv))->xnv_u.xpad_cop_seq.xlow = val; } while (0) -# define COP_SEQ_RANGE_HIGH_set(sv,val) \ +# define COP_SEQ_RANGE_HIGH_set(sv,val) \ do { ((XPVNV *)SvANY(sv))->xnv_u.xpad_cop_seq.xhigh = val; } while (0) +# endif #endif #ifndef PERL_PADSEQ_INTRO @@ -43,13 +50,18 @@ #define lex_stuff_pvs_(s, flags) \ lex_stuff_pvn_((""s""), sizeof(""s"")-1, (flags)) +#ifndef padnamelist_store +# define padnamelist_store av_store +#endif + #define QPARSE_DIRECTLY PERL_VERSION_GE(5,13,8) static PADOFFSET pad_add_my_array_pvn (pTHX_ const char *namepv, STRLEN namelen) { PADOFFSET offset; - SV *namesv, *myvar; + PADNAME *namesv; + SV *myvar; myvar = *av_fetch(PL_comppad, AvFILLp(PL_comppad) + 1, 1); sv_upgrade(myvar, SVt_PVAV); @@ -57,14 +69,18 @@ pad_add_my_array_pvn (pTHX_ const char * SvPADMY_on(myvar); PL_curpad = AvARRAY(PL_comppad); +#ifdef newPADNAMEpvn + namesv = newPADNAMEpvn(namepv, namelen); +#else namesv = newSV_type(SVt_PADNAME); sv_setpvn(namesv, namepv, namelen); +#endif COP_SEQ_RANGE_LOW_set(namesv, PL_cop_seqmax); COP_SEQ_RANGE_HIGH_set(namesv, PERL_PADSEQ_INTRO); PL_cop_seqmax++; - av_store(PL_comppad_name, offset, namesv); + padnamelist_store(PL_comppad_name, offset, namesv); #if PERL_VERSION_GE(5,19,3) PadnamelistMAXNAMED(PL_comppad_name) = offset; #endif @@ -144,12 +160,12 @@ gen_take_op (pTHX_ OP *listop, PADOFFSET { OP *takeop; - NewOpSz(0, takeop, sizeof(UNOP)); + NewOpSz(0, takeop, sizeof(LISTOP)); takeop->op_type = OP_SPLICE; takeop->op_ppaddr = pp_take; takeop->op_targ = gatherer_offset; cUNOPx(takeop)->op_flags = OPf_KIDS; - cUNOPx(takeop)->op_first = listop; + cLISTOPx(takeop)->op_first = cLISTOPx(takeop)->op_last = listop; return takeop; } @@ -195,20 +211,24 @@ myck_entersub_gatherer_intro (pTHX_ OP * static OP * myck_entersub_gather (pTHX_ OP *entersubop, GV *namegv, SV *protosv) { - OP *rv2cvop, *pushop, *blkop; + OP *rv2cvop, *pushop, *blkop, *parent; PERL_UNUSED_ARG(namegv); PERL_UNUSED_ARG(protosv); - pushop = cUNOPx(entersubop)->op_first; + pushop = cUNOPx((parent = entersubop))->op_first; if (!pushop->op_sibling) - pushop = cUNOPx(pushop)->op_first; + pushop = cUNOPx((parent = pushop))->op_first; blkop = pushop->op_sibling; +#ifdef op_sibling_splice + op_sibling_splice(parent, pushop, 1, NULL); +#else rv2cvop = blkop->op_sibling; blkop->op_sibling = NULL; pushop->op_sibling = rv2cvop; +#endif op_free(entersubop); return blkop; @@ -238,8 +258,12 @@ myck_entersub_take (pTHX_ OP *entersubop lastop = lastop->op_sibling; rv2cvop = lastop->op_sibling; +#ifdef op_sibling_splice + op_sibling_splice(listop, lastop, -1, NULL); +#else lastop->op_sibling = NULL; cLISTOPx(listop)->op_last = lastop; +#endif op_free(rv2cvop); return gen_take_op(aTHX_ listop, gatherer_offset);
On 2014-12-27 17:27:00, SPROUT wrote: Show quoted text
> Here is a patch. I have only tested it with bleadperl.
Looks good on 5.21.7 as well. Many thanks! released as version 0.10.
On 2014-12-27 20:27:00, SPROUT wrote: Show quoted text
> On Sat Dec 27 15:54:33 2014, SREZIC wrote:
> > Starting with perl 5.21.7 there are segfaults when running the test > > suite (seen on linux and freebsd systems, fail reports will follow on > > cpantesters). perl 5.21.6 and less looks fine. > > > > Test Summary Report > > ------------------- > > t/basic.t (Wstat: 11 Tests: 1 Failed: 0) > > Non-zero wait status: 11 > > Parse errors: No plan found in TAP output > > t/context.t (Wstat: 11 Tests: 0 Failed: 0) > > Non-zero wait status: 11 > > Parse errors: No plan found in TAP output > > t/errors.t (Wstat: 11 Tests: 0 Failed: 0) > > Non-zero wait status: 11 > > Parse errors: No plan found in TAP output > > t/exceptions.t (Wstat: 11 Tests: 0 Failed: 0) > > Non-zero wait status: 11 > > Parse errors: No plan found in TAP output > > t/modifier.t (Wstat: 11 Tests: 0 Failed: 0) > > Non-zero wait status: 11 > > Parse errors: No plan found in TAP output > > t/return.t (Wstat: 11 Tests: 0 Failed: 0) > > Non-zero wait status: 11 > > Parse errors: No plan found in TAP output > > t/syntax.t (Wstat: 11 Tests: 0 Failed: 0) > > Non-zero wait status: 11 > > Parse errors: No plan found in TAP output
> > Here is a patch. I have only tested it with bleadperl. >
Unfortunately it does not compile anymore with 5.16 and earlier: cc -c -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I. -O -DVERSION=\"0.10\" -DXS_VERSION=\"0.10\" -DPIC -fPIC "-I/usr/perl5.16.3t/lib/5.16.3/amd64-freebsd-thread-multi/CORE" Gather.c Gather.xs: In function 'pad_add_my_array_pvn': Gather.xs:63: error: 'PADNAME' undeclared (first use in this function) Gather.xs:63: error: (Each undeclared identifier is reported only once Gather.xs:63: error: for each function it appears in.) Gather.xs:63: error: 'namesv' undeclared (first use in this function) *** [Gather.o] Error code 1
On 2014-12-27 23:43:32, SREZIC wrote: Show quoted text
> Unfortunately it does not compile anymore with 5.16 and earlier:
curses, foiled again!
On Sun Dec 28 04:19:17 2014, ETHER wrote: Show quoted text
> On 2014-12-27 23:43:32, SREZIC wrote: >
> > Unfortunately it does not compile anymore with 5.16 and earlier:
> > curses, foiled again!
OK, then try this patch. This time I only tested it with 5.12.4. I usually make the patches from within the CPAN shell (‘look Whatever’, duplicate the current folder, then tweak till tests pass), which makes it hard to test them with multiple perl versions. I had assumed that most CPAN authors would test with a dozen perl versions before release, the way I do.
Subject: open_bZbvrdbr.txt
diff -rup List-Gather-0.10-_39UCg-orig/Gather.xs List-Gather-0.10-_39UCg/Gather.xs --- List-Gather-0.10-_39UCg-orig/Gather.xs 2014-12-27 21:09:24.000000000 -0800 +++ List-Gather-0.10-_39UCg/Gather.xs 2014-12-28 10:57:39.000000000 -0800 @@ -60,7 +60,11 @@ static PADOFFSET pad_add_my_array_pvn (pTHX_ const char *namepv, STRLEN namelen) { PADOFFSET offset; +#ifdef newPADNAMEpvn PADNAME *namesv; +#else + SV *namesv; +#endif SV *myvar; myvar = *av_fetch(PL_comppad, AvFILLp(PL_comppad) + 1, 1);
On 2014-12-28 11:00:22, SPROUT wrote: Show quoted text
> OK, then try this patch. This time I only tested it with 5.12.4. I > usually make the patches from within the CPAN shell (‘look Whatever’, > duplicate the current folder, then tweak till tests pass), which makes > it hard to test them with multiple perl versions. > > I had assumed that most CPAN authors would test with a dozen perl > versions before release, the way I do.
I really should have, and am doing so now with this patch!
On 2014-12-28 11:54:04, ETHER wrote: Show quoted text
> On 2014-12-28 11:00:22, SPROUT wrote: >
> > OK, then try this patch. This time I only tested it with 5.12.4. I > > usually make the patches from within the CPAN shell (‘look Whatever’, > > duplicate the current folder, then tweak till tests pass), which makes > > it hard to test them with multiple perl versions. > > > > I had assumed that most CPAN authors would test with a dozen perl > > versions before release, the way I do.
> > I really should have, and am doing so now with this patch! >
Tested successfully on: 5.12.5 5.14.4 5.16.3 5.18.4 5.20.1 5.21.5 5.21.6 5.21.7 releasing as 0.11; many thanks!