bpo-38965: Fix stuck in test_stack_overflow tests.#17462
Closed
marxin wants to merge 1 commit into
Closed
Conversation
7bee273 to
38206ab
Compare
After update to GCC10, the testcase is stuck and a pragma needs to be added.
38206ab to
78a2825
Compare
vstinner
reviewed
Dec 4, 2019
vstinner
left a comment
Member
There was a problem hiding this comment.
Would it be possible to modify stack_overflow() so GCC couldn't turn the tail call into a loop?
Author
Well, based on the discussion for https://bugs.python.org/issue23654 |
Author
|
An alternative fix would be someting like: diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index d1280532ae..7a48a39be4 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -1167,6 +1167,9 @@ faulthandler_fatal_error_py(PyObject *self, PyObject *args)
* a loop. */
# pragma intel optimization_level 0
#endif
+
+unsigned char *buffer_ptr;
+
static
uintptr_t
stack_overflow(uintptr_t min_sp, uintptr_t max_sp, size_t *depth)
@@ -1179,6 +1182,7 @@ stack_overflow(uintptr_t min_sp, uintptr_t max_sp, size_t *depth)
return sp;
buffer[0] = 1;
buffer[4095] = 0;
+ buffer_ptr = &buffer[0];
return stack_overflow(min_sp, max_sp, depth);
}@vstinner What do you prefer? |
Member
|
If "+ buffer_ptr = &buffer[0];" prevents compiler specific pragma and fix the bug, yes: I prefer code working on any compiler ;-) |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After update to GCC10, the testcase is stuck and
a pragma needs to be added.
https://bugs.python.org/issue38965