summaryrefslogtreecommitdiff
path: root/debian/patches/debian/disable-stack-check.diff
blob: c5bd2f713335dd84eb8f91143f1f3849f1fca266 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From: Niko Tyni <ntyni@debian.org>
Date: Mon, 16 Jul 2018 10:12:37 +0300
Subject: Disable debugperl stack extension checks for binary compatibility
 with perl

When an XS module is built without -DDEBUGGING but the interpreter is,
the debugging stack high-water mark checking on the interpreter side
doesn't work properly. This makes /usr/bin/debugperl less useful than
it could be as it can no longer use many XS module packages.

Patch the check away for now. We hope upstream will provide a Configure
option for this in the future.

Bug: https://rt.perl.org/Ticket/Display.html?id=133327
Bug-Debian: https://bugs.debian.org/902779
---
 dump.c   | 3 +++
 pp_hot.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/dump.c b/dump.c
index 9de1941..cf78366 100644
--- a/dump.c
+++ b/dump.c
@@ -2501,6 +2501,8 @@ Perl_runops_debug(pTHX)
         ++PL_op_exec_cnt[PL_op->op_type];
 #endif
 #if defined DEBUGGING && !defined DEBUGGING_RE_ONLY
+/* disabled on Debian due to https://bugs.debian.org/902779 */
+#ifndef DEBIAN
         if (PL_curstackinfo->si_stack_hwm < PL_stack_sp - PL_stack_base)
             Perl_croak_nocontext(
                 "panic: previous op failed to extend arg stack: "
@@ -2508,6 +2510,7 @@ Perl_runops_debug(pTHX)
                     PL_stack_base, PL_stack_sp,
                     PL_stack_base + PL_curstackinfo->si_stack_hwm);
         PL_curstackinfo->si_stack_hwm = PL_stack_sp - PL_stack_base;
+#endif
 #endif
 	if (PL_debug) {
             ENTER;
diff --git a/pp_hot.c b/pp_hot.c
index 7d5ffc0..7d15ca6 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -5237,6 +5237,8 @@ PP(pp_entersub)
 	CvXSUB(cv)(aTHX_ cv);
 
 #if defined DEBUGGING && !defined DEBUGGING_RE_ONLY
+/* disabled on Debian due to https://bugs.debian.org/902779 */
+#ifndef DEBIAN
         /* This duplicates the check done in runops_debug(), but provides more
          * information in the common case of the fault being with an XSUB.
          *
@@ -5250,6 +5252,7 @@ PP(pp_entersub)
                     HvNAME(GvSTASH(CvGV(cv))), GvNAME(CvGV(cv)), CvFILE(cv),
                     PL_stack_base, PL_stack_sp,
                     PL_stack_base + PL_curstackinfo->si_stack_hwm);
+#endif
 #endif
 	/* Enforce some sanity in scalar context. */
 	if (is_scalar) {