[Python-checkins] bpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970)

Victor Stinner webhook-mailer at python.org
Tue Apr 30 06:19:56 EDT 2019


https://github.com/python/cpython/commit/b84cb70880a0acfcbbaca7bcda405af08f94d269
commit: b84cb70880a0acfcbbaca7bcda405af08f94d269
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2019-04-30T12:19:34+02:00
summary:

bpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970)

Initialize "stack_t current_stack" to zero using memset().

files:
A Misc/NEWS.d/next/Library/2019-04-26-17-14-20.bpo-36734.p2MaiN.rst
M Modules/faulthandler.c

diff --git a/Misc/NEWS.d/next/Library/2019-04-26-17-14-20.bpo-36734.p2MaiN.rst b/Misc/NEWS.d/next/Library/2019-04-26-17-14-20.bpo-36734.p2MaiN.rst
new file mode 100644
index 000000000000..09341990a63d
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-04-26-17-14-20.bpo-36734.p2MaiN.rst
@@ -0,0 +1,2 @@
+Fix compilation of ``faulthandler.c`` on HP-UX. Initialize ``stack_t
+current_stack`` to zero using ``memset()``.
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 30fe18695fec..d45b8660ee65 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -1370,7 +1370,8 @@ void _PyFaulthandler_Fini(void)
 #ifdef HAVE_SIGALTSTACK
     if (stack.ss_sp != NULL) {
         /* Fetch the current alt stack */
-        stack_t current_stack = {};
+        stack_t current_stack;
+        memset(&current_stack, 0, sizeof(current_stack));
         if (sigaltstack(NULL, &current_stack) == 0) {
             if (current_stack.ss_sp == stack.ss_sp) {
                 /* The current alt stack is the one that we installed.



More information about the Python-checkins mailing list