You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by go...@apache.org on 2004/10/14 20:25:01 UTC
cvs commit: modperl-2.0/src/modules/perl modperl_util.c
gozer 2004/10/14 11:25:01
Modified: . Changes
src/modules/perl modperl_util.c
Log:
Replace Perl_load_module() with a simpler eval "use Module version ()"
to work around what seems to be a potential bug in Perl_load_module()
Was causing segfaults with worker MPM.
PR: http://marc.theaimsgroup.com/?t=109684579900001&r=1&w=2
Revision Changes Path
1.512 +2 -0 modperl-2.0/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/modperl-2.0/Changes,v
retrieving revision 1.511
retrieving revision 1.512
diff -u -r1.511 -r1.512
--- Changes 11 Oct 2004 23:10:57 -0000 1.511
+++ Changes 14 Oct 2004 18:25:01 -0000 1.512
@@ -12,6 +12,8 @@
=item 1.99_17-dev
+Workaround a possible bug in Perl_load_module() [Gozer]
+
Fix a problem building with non-GNU make (can't make target dynamic
in xs/APR/aprext) [Gozer]
1.84 +23 -3 modperl-2.0/src/modules/perl/modperl_util.c
Index: modperl_util.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- modperl_util.c 16 Sep 2004 16:36:29 -0000 1.83
+++ modperl_util.c 14 Oct 2004 18:25:01 -0000 1.84
@@ -705,16 +705,36 @@
dSP;
int count;
SV *bdeparse;
+ SV *use;
char *text;
+ int tainted_orig;
/* B::Deparse >= 0.61 needed for blessed code references.
* 0.6 works fine for non-blessed code refs.
* notice that B::Deparse is not CPAN-updatable.
* 0.61 is available starting from 5.8.0
*/
- Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT,
- newSVpvn("B::Deparse", 10),
- newSVnv(SvOBJECT((SV*)cv) ? 0.61 : 0.60));
+
+ /*
+ Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT,
+ newSVpvn("B::Deparse", 10),
+ newSVnv(SvOBJECT((SV*)cv) ? 0.61 : 0.60));
+ * Perl_load_module() was causing segfaults in the worker MPM.
+ * this is a work around until we can find the problem with
+ * Perl_load_module()
+ * See: http://marc.theaimsgroup.com/?t=109684579900001&r=1&w=2
+ */
+ use = newSVpv("use B::Deparse ", 15);
+ if (SvOBJECT((SV*)cv)) {
+ sv_catpvn(use, "0.61", 3);
+ }
+ sv_catpvn(use, " ();", 4);
+
+ tainted_orig = PL_tainted;
+ TAINT_NOT;
+ eval_sv(use, G_DISCARD);
+ PL_tainted = tainted_orig;
+ sv_free(use);
ENTER;
SAVETMPS;