-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-33955: Support USE_STACKCHECK on macOS #8046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The basic patch looks ok. Please add a test that demonstrates that the new code works. For example by setting the recursion limit to a too high value and check that this doesn't crash the interpreter (there may be a test for this that's only enabled for windows at the moment).
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Thank you for a quick review. |
148001b
to
4be8d33
Compare
https://github.com/python/cpython/blob/master/Lib/test/crashers/recursive_call.py As far as I know, a unit test for USE_STACKCHECK is only /Lib/test/crashers/recursive_call.py. |
@ronaldoussoren I added a logic for estimating a new stack space by using the stack space that was just needed. |
b5e933f
to
138eba1
Compare
ada28bf
to
181fa6e
Compare
d1919f5
to
131dfee
Compare
Thank you for the kind review and thank you for the guide about how to use ThreadState.
|
|
@vstinner Thanks for understanding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I'm not super excited by the implementation. I'm not sure that it's correct. But I added a few comments.
{ | ||
PyThreadState *tstate = _PyThreadState_GET(); | ||
Init_Stack_Status(tstate); | ||
const uintptr_t end = (uintptr_t)pthread_get_stackaddr_np(pthread_self()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if it's implemented in pure userspace, or if it's a system call?
@vstinner I applied your review and some of the issues are under investigation. List
|
@corona10, is this still waiting changes or should it be moved back to code review? Thanks! |
@vstinner @ronaldoussoren Let's reopen this PR when we need this feature ;) |
https://bugs.python.org/issue33955