Skip to content

Commit 78a2825

Browse files
committed
bpo-38965: Fix stuck in test_stack_overflow tests.
After update to GCC10, the testcase is stuck and a pragma needs to be added.
1 parent 83f1449 commit 78a2825

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
After update to GCC10, the testcase is stuck and
2+
a pragma needs to be added.

Modules/faulthandler.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,11 @@ faulthandler_fatal_error_py(PyObject *self, PyObject *args)
11691169
#endif
11701170
static
11711171
uintptr_t
1172+
#ifdef __GNUC__
1173+
/* For the very same reason, the GCC compiler can turn the tail
1174+
* call into a loop. */
1175+
__attribute__((optimize("-O0")))
1176+
#endif
11721177
stack_overflow(uintptr_t min_sp, uintptr_t max_sp, size_t *depth)
11731178
{
11741179
/* allocate 4096 bytes on the stack at each call */

0 commit comments

Comments
 (0)