Skip Menu |

This queue is for tickets about the mod_perl CPAN distribution.

Report information
The Basics
Id: 64999
Status: resolved
Priority: 0/
Queue: mod_perl

People
Owner: Nobody in particular
Requestors: davem [...] iabyn.com
Cc:
AdminCc:

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



Subject: GvCV and GvGP lvalue changes in perl core
Date: Fri, 21 Jan 2011 16:37:26 +0000
To: bug-mod_perl [...] rt.cpan.org
From: Dave Mitchell <davem [...] iabyn.com>
Hi, A search of sources on CPAN shows that your module(s) use GvCV() and/or GvGP() in an lvalue context (i.e. you assign to it). From perl 5.13.10 onwards, this will no longer be allowed, and you'll need to update your source code in such a way as to be compatible with both existing and the new perls. Probably the easiest way to do this is to add the following definitions: #ifndef GvCV_set # define GvCV_set(gv,cv) (GvGP(gv)->gp_cv = (cv)) #endif #ifndef GvGP_set # define GvGP_set(gv,gp) ((gv)->sv_u.svu_gp = (gp)) #endif then replace code like the following: GvGP(gv) = gp; GvCV(gv) = cv; with GvGP_set(gv, gp); GvCV_set(gv, cv); If you do something like SAVEGENERICSV(&(GvCV(gv))) then you may need to replace it with a custom SAVEDESTRUCTOR() or similar that does a GvCV_set(gv,old_value) upon restoration.
Subject: Re: [rt.cpan.org #64999] AutoReply: GvCV and GvGP lvalue changes in perl core
Date: Fri, 21 Jan 2011 17:36:10 +0000
To: Bugs in mod_perl via RT <bug-mod_perl [...] rt.cpan.org>
From: Dave Mitchell <davem [...] iabyn.com>
On Fri, Jan 21, 2011 at 11:37:34AM -0500, I wrote: Show quoted text
> # define GvCV_set(gv,cv) (GvGP(gv)->gp_cv = (cv))
[snip] Show quoted text
> # define GvGP_set(gv,gp) ((gv)->sv_u.svu_gp = (gp))
Actually on reflection, those could be better written as: #define GvCV_set(gv, cv) (GvCV(gv) = (cv)) #define GvGP_set(gv, gp) (GvGP(gv) = (gp)) -- O Unicef Clearasil! Gibberish and Drivel! -- "Bored of the Rings"
Subject: Fwd: [rt.cpan.org #64999] AutoReply: GvCV and GvGP lvalue changes in perl core
Date: Fri, 21 Jan 2011 20:34:48 -0800
To: bug-mod_perl [...] rt.cpan.org, mod_perl Dev <dev [...] perl.apache.org>
From: Fred Moyer <fred [...] redhotpenguin.com>
Cc'ing the ticket so Dave can join in the list discussion. Show quoted text
---------- Forwarded message ---------- From: Dave Mitchell via RT <bug-mod_perl@rt.cpan.org> Date: Fri, Jan 21, 2011 at 9:36 AM Subject: Re: [rt.cpan.org #64999] AutoReply: GvCV and GvGP lvalue changes in perl core To:       Queue: mod_perl  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=64999 > On Fri, Jan 21, 2011 at 11:37:34AM -0500, I wrote:
>     #  define GvCV_set(gv,cv) (GvGP(gv)->gp_cv = (cv))
[snip]
>     #  define GvGP_set(gv,gp) ((gv)->sv_u.svu_gp = (gp))
Actually on reflection, those could be better written as:        #define GvCV_set(gv, cv) (GvCV(gv) = (cv))        #define GvGP_set(gv, gp) (GvGP(gv) = (gp)) -- O Unicef Clearasil! Gibberish and Drivel!    -- "Bored of the Rings"
From: sendwade [...] hotmail.com
Attached is a patch that gets mod_perl 1 + perl 5.14 going, or at least gets it to build and pass tests. I haven't ran any of my apps against it yet.
Subject: mp1+perl5.14.diff
--- mod_perl-1.31/src/modules/perl/mod_perl.orig.h 2011-07-11 17:16:57.000000000 -0700 +++ mod_perl-1.31/src/modules/perl/mod_perl.h 2011-07-11 17:31:59.000000000 -0700 @@ -1026,6 +1026,14 @@ #define PERL_HEADER_PARSER_CREATE(s) #endif +#ifndef GvCV_set +#define GvCV_set(gv, cv) (GvCV(gv) = (cv)) +#endif + +#ifndef GvCV_set +#define CvGV_set(gv, cv) (CvVG(gv) = (cv)) +#endif + typedef struct { array_header *PerlPassEnv; array_header *PerlRequire; --- mod_perl-1.31/Symbol/Symbol.orig.xs 2011-07-11 17:34:18.000000000 -0700 +++ mod_perl-1.31/Symbol/Symbol.xs 2011-07-11 17:37:28.000000000 -0700 @@ -30,7 +30,7 @@ has_proto = TRUE; cv_undef(cv); - CvGV(cv) = gv; /* let user-undef'd sub keep its identity */ + CvGV_set(cv, gv); /* let user-undef'd sub keep its identity */ if(has_proto) SvPOK_on(cv); /* otherwise we get `Prototype mismatch:' */ --- mod_perl-1.31/src/modules/perl/mod_perl.orig.c 2011-07-11 17:06:31.000000000 -0700 +++ mod_perl-1.31/src/modules/perl/mod_perl.c 2011-07-11 17:15:24.000000000 -0700 @@ -785,7 +785,7 @@ /* *CORE::GLOBAL::exit = \&Apache::exit */ if(gv_stashpv("CORE::GLOBAL", FALSE)) { GV *exitgp = gv_fetchpv("CORE::GLOBAL::exit", TRUE, SVt_PVCV); - GvCV(exitgp) = perl_get_cv("Apache::exit", TRUE); + GvCV_set(exitgp, perl_get_cv("Apache::exit", TRUE)); GvIMPORTED_CV_on(exitgp); } --- mod_perl-1.31/src/modules/perl/perl_config.orig.c 2011-07-11 17:25:44.000000000 -0700 +++ mod_perl-1.31/src/modules/perl/perl_config.c 2011-07-11 17:29:07.000000000 -0700 @@ -1720,7 +1720,7 @@ if((cv = GvCV((GV*)val)) && (GvSTASH((GV*)val) == GvSTASH(CvGV(cv)))) { GV *gv = CvGV(cv); cv_undef(cv); - CvGV(cv) = gv; + CvGV_set(cv, gv); GvCVGEN(gv) = 1; /* invalidate method cache */ } } --- mod_perl-1.31/src/modules/perl/Log.orig.xs 2011-07-11 17:06:20.000000000 -0700 +++ mod_perl-1.31/src/modules/perl/Log.xs 2011-07-11 17:13:19.000000000 -0700 @@ -10,7 +10,7 @@ static void perl_cv_alias(char *to, char *from) { GV *gp = gv_fetchpv(to, TRUE, SVt_PVCV); - GvCV(gp) = perl_get_cv(from, TRUE); + GvCV_set(gp, perl_get_cv(from, TRUE)); } static void ApacheLog(int level, SV *sv, SV *msg) --- mod_perl-1.31/src/modules/perl/Constants.orig.xs 2011-07-11 17:06:11.000000000 -0700 +++ mod_perl-1.31/src/modules/perl/Constants.xs 2011-07-11 17:12:29.000000000 -0700 @@ -20,7 +20,7 @@ SvPVX(caller), sub, SvPVX(pclass), sub); #endif gv = gv_fetchpv(form("%_::%s", caller, sub), TRUE, SVt_PVCV); - GvCV(gv) = perl_get_cv(form("%_::%s", pclass, sub), TRUE); + GvCV_set(gv, perl_get_cv(form("%_::%s", pclass, sub), TRUE)); GvIMPORTED_CV_on(gv); }
RT-Send-CC: sendwade [...] hotmail.com
Resolved in svn revision 1151596, will be released with mod_perl 1.32. Thanks for the fix!
found this ticket via google. FYI: --- mp1+perl5.14.diff.orig 2013-06-21 03:35:03.000000000 -0400 +++ mp1+perl5.14.diff 2013-06-21 03:35:10.000000000 -0400 @@ -8,7 +8,7 @@ +#define GvCV_set(gv, cv) (GvCV(gv) = (cv)) +#endif + -+#ifndef GvCV_set ++#ifndef CvGV_set +#define CvGV_set(gv, cv) (CvVG(gv) = (cv)) +#endif +
On Fri Jun 21 03:36:18 2013, JKISTER wrote: Show quoted text
> found this ticket via google. FYI: > > --- mp1+perl5.14.diff.orig 2013-06-21 03:35:03.000000000 -0400 > +++ mp1+perl5.14.diff 2013-06-21 03:35:10.000000000 -0400 > @@ -8,7 +8,7 @@ > +#define GvCV_set(gv, cv) (GvCV(gv) = (cv)) > +#endif > + > -+#ifndef GvCV_set > ++#ifndef CvGV_set > +#define CvGV_set(gv, cv) (CvVG(gv) = (cv)) > +#endif > +
FWIW, this (and another typo in CvVG!) were fixed in rev. 1152547.