Skip to content

Commit 504c01b

Browse files
committed
no patch to 5.6.0 is needed when PERL_SET_CONTEXT is properly used
tell perl_clone() not to clone the stacks (requires scopestack_ix hack) PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/trunk@67992 13f79535-47bb-0310-9956-ffa450edef68
1 parent 9e37de1 commit 504c01b

File tree

5 files changed

+14
-48
lines changed

5 files changed

+14
-48
lines changed

00README_FIRST

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ more detailed design docs, etc. will follow along with updates here
88
and on the list
99

1010
if you want to try building with an interpreter pool, you'll need Perl
11-
5.6.0 with patches/perl_no_get_context.pat applied and Perl built like
12-
so:
11+
5.6.0 built like so:
1312

1413
% ./Configure -des -Dusethreads
1514

Makefile.PL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ WriteMakefile(
2626
VERSION => $VERSION,
2727
macro => {
2828
MODPERL_SRC => $code->path,
29-
PERL => $build->perl_config('perl5'),
29+
PERL => $build->perl_config('perlpath'),
3030
},
3131
clean => {
3232
FILES => "@{ clean_files() }",

patches/perl_no_get_context.pat

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/modules/perl/modperl_callback.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ int modperl_run_handlers(int idx, request_rec *r, conn_rec *c,
339339
/* Child{Init,Exit}, OpenLogs */
340340
aTHX = scfg->mip->parent->perl;
341341
}
342+
PERL_SET_CONTEXT(aTHX);
342343
#endif
343344

344345
MP_TRACE_h(MP_FUNC, "running %d %s handlers\n",

src/modules/perl/modperl_interp.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,17 @@ modperl_interp_t *modperl_interp_new(ap_pool_t *p,
2424
);
2525
#endif
2626

27-
interp->perl = perl_clone(perl, TRUE);
27+
interp->perl = perl_clone(perl, FALSE);
28+
{
29+
/* XXX: hack for bug fixed in 5.6.1 */
30+
dTHXa(interp->perl);
31+
if (PL_scopestack_ix == 0) {
32+
ENTER;
33+
}
34+
}
35+
2836
MpInterpCLONED_On(interp);
37+
PERL_SET_CONTEXT(mip->parent->perl);
2938

3039
#ifdef MP_USE_GTOP
3140
MP_TRACE_m_do(
@@ -50,6 +59,7 @@ void modperl_interp_destroy(modperl_interp_t *interp)
5059
MP_TRACE_i(MP_FUNC, "*error - still in use!*\n");
5160
}
5261

62+
PERL_SET_CONTEXT(interp->perl);
5363
PL_perl_destruct_level = 2;
5464
perl_destruct(interp->perl);
5565
perl_free(interp->perl);

0 commit comments

Comments
 (0)