summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-04-14 15:51:33 +0200
committerKarl Williamson <public@khwilliamson.com>2013-05-09 08:49:41 -0600
commit47c9d59fcd27684d94480b806b8b6e001aac91cc (patch)
tree0d1d8053a6c41f471d366c40344ff28f072313e4 /dump.c
parentd16360cf46a05f65d649c1fe5a38802db2c250d4 (diff)
downloadperl-47c9d59fcd27684d94480b806b8b6e001aac91cc.tar.gz
Remove PERL_ASYNC_CHECK() from Perl_leave_scope().
PERL_ASYNC_CHECK() was added to Perl_leave_scope() as part of commit f410a2119920dd04, which moved signal dispatch from the runloop to control flow ops, to mitigate nearly all of the speed cost of safe signals. The assumption was that scope exit was a safe place to dispatch signals. However, this is not true, as parts of the regex engine call leave_scope(), the regex engine stores some state in per-interpreter variables, and code called within signal handlers can change these values. Hence remove the call to PERL_ASYNC_CHECK() from Perl_leave_scope(), and add it explicitly in the various OPs which were relying on their call to leave_scope() to dispatch any pending signals. Also add a PERL_ASYNC_CHECK() to the exit of the runloop, which ensures signals still dispatch from S_sortcv() and S_sortcv_stacked(), as well as addressing one of the concerns in the commit message of f410a2119920dd04: Subtle bugs might remain - there might be constructions that enter the runloop (where signals used to be dispatched) but don't contain any PERL_ASYNC_CHECK() calls themselves. Finally, move the PERL_ASYNC_CHECK(); added by that commit to pp_goto to the end of the function, to be consistent with the positioning of all other PERL_ASYNC_CHECK() calls - at the beginning or end of OP functions, hence just before the return to or just after the call from the runloop, and hence effectively at the same point as the previous location of PERL_ASYNC_CHECK() in the runloop.
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/dump.c b/dump.c
index 4e630ec399..a25740bf9b 100644
--- a/dump.c
+++ b/dump.c
@@ -2212,6 +2212,7 @@ Perl_runops_debug(pTHX)
OP_ENTRY_PROBE(OP_NAME(PL_op));
} while ((PL_op = PL_op->op_ppaddr(aTHX)));
DEBUG_l(Perl_deb(aTHX_ "leaving RUNOPS level\n"));
+ PERL_ASYNC_CHECK();
TAINT_NOT;
return 0;