SOURCES: apache1-mod_perl-perl510.patch (NEW) - fix SEGV with perl...

areq areq at pld-linux.org
Sat May 3 19:41:57 CEST 2008


Author: areq                         Date: Sat May  3 17:41:57 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fix SEGV with perl 5.10 

---- Files affected:
SOURCES:
   apache1-mod_perl-perl510.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/apache1-mod_perl-perl510.patch
diff -u /dev/null SOURCES/apache1-mod_perl-perl510.patch:1.1
--- /dev/null	Sat May  3 19:41:57 2008
+++ SOURCES/apache1-mod_perl-perl510.patch	Sat May  3 19:41:52 2008
@@ -0,0 +1,46 @@
+--- 1.x/src/modules/perl/mod_perl.h       2007/07/13 08:17:02     555907
++++ 1.x/src/modules/perl/mod_perl.h       2007/07/13 08:21:11     555908
+@@ -301,6 +301,13 @@
+
+ #define av_copy_array(av) av_make(av_len(av)+1, AvARRAY(av))
+
++#define MP_safe_av_undef(av) \
++if (av != Nullav) { \
++    av_undef(av); \
++    SvREFCNT_dec((SV*)av); \
++    av = Nullav; \
++}
++
+ #ifndef newRV_noinc
+ #define newRV_noinc(sv)        ((Sv = newRV(sv)), --SvREFCNT(SvRV(Sv)), Sv)
+ #endif
+
+--- 1.x/src/modules/perl/mod_perl.c       2007/07/13 08:17:02     555907
++++ 1.x/src/modules/perl/mod_perl.c       2007/07/13 08:21:11     555908
+@@ -277,13 +277,8 @@
+
+     mp_request_rec = 0;
+
+-    av_undef(orig_inc);
+-    SvREFCNT_dec((SV*)orig_inc);
+-    orig_inc = Nullav;
+-
+-    av_undef(cleanup_av);
+-    SvREFCNT_dec((SV*)cleanup_av);
+-    cleanup_av = Nullav;
++    MP_safe_av_undef(orig_inc)
++    MP_safe_av_undef(cleanup_av)
+
+ #ifdef PERL_STACKED_HANDLERS
+     hv_undef(stacked_handlers);
+@@ -1159,9 +1154,7 @@
+     perl_clear_env();
+
+     /* reset @INC */
+-    av_undef(GvAV(incgv));
+-    SvREFCNT_dec(GvAV(incgv));
+-    GvAV(incgv) = Nullav;
++    MP_safe_av_undef(GvAV(incgv))
+     GvAV(incgv) = av_copy_array(orig_inc);
+
+     /* reset $/ */
================================================================


More information about the pld-cvs-commit mailing list