File tree 3 files changed +14
-17
lines changed
3 files changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,8 @@ extern "C" {
8
8
# error "this header requires Py_BUILD_CORE define"
9
9
#endif
10
10
11
-
12
11
#ifdef HAVE_SIGACTION
13
- #include <signal.h>
12
+ # include <signal.h>
14
13
#endif
15
14
16
15
@@ -23,10 +22,15 @@ extern "C" {
23
22
24
23
25
24
#ifdef HAVE_SIGACTION
25
+ /* Using an alternative stack requires sigaltstack()
26
+ and sigaction() SA_ONSTACK */
27
+ # ifdef HAVE_SIGALTSTACK
28
+ # define FAULTHANDLER_USE_ALT_STACK
29
+ # endif
26
30
typedef struct sigaction _Py_sighandler_t ;
27
31
#else
28
32
typedef PyOS_sighandler_t _Py_sighandler_t ;
29
- #endif
33
+ #endif // HAVE_SIGACTION
30
34
31
35
32
36
#ifdef FAULTHANDLER_USER
@@ -74,6 +78,11 @@ struct _faulthandler_runtime_state {
74
78
#ifdef FAULTHANDLER_USER
75
79
struct faulthandler_user_signal * user_signals ;
76
80
#endif
81
+
82
+ #ifdef FAULTHANDLER_USE_ALT_STACK
83
+ stack_t stack ;
84
+ stack_t old_stack ;
85
+ #endif
77
86
};
78
87
79
88
#define _faulthandler_runtime_state_INIT \
Original file line number Diff line number Diff line change 18
18
# include <sys/resource.h>
19
19
#endif
20
20
21
- /* Using an alternative stack requires sigaltstack()
22
- and sigaction() SA_ONSTACK */
23
- #if defined(HAVE_SIGALTSTACK ) && defined(HAVE_SIGACTION )
24
- # define FAULTHANDLER_USE_ALT_STACK
25
- #endif
26
-
27
21
#if defined(FAULTHANDLER_USE_ALT_STACK ) && defined(HAVE_LINUX_AUXVEC_H ) && defined(HAVE_SYS_AUXV_H )
28
22
# include <linux/auxvec.h> // AT_MINSIGSTKSZ
29
23
# include <sys/auxv.h> // getauxval()
@@ -86,8 +80,8 @@ static const size_t faulthandler_nsignals = \
86
80
Py_ARRAY_LENGTH (faulthandler_handlers );
87
81
88
82
#ifdef FAULTHANDLER_USE_ALT_STACK
89
- static stack_t stack ;
90
- static stack_t old_stack ;
83
+ # define stack _PyRuntime.faulthandler.stack
84
+ # define old_stack _PyRuntime.faulthandler.old_stack
91
85
#endif
92
86
93
87
Original file line number Diff line number Diff line change @@ -361,12 +361,6 @@ Modules/itertoolsmodule.c - tee_type -
361
361
Modules/itertoolsmodule.c - teedataobject_type -
362
362
Modules/itertoolsmodule.c - ziplongest_type -
363
363
364
- # #-----------------------
365
- # # state
366
-
367
- Modules/faulthandler.c - stack -
368
- Modules/faulthandler.c - old_stack -
369
-
370
364
371
365
# #################################
372
366
# # global non-objects to fix in builtin modules
You can’t perform that action at this time.
0 commit comments