Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-33955: Support USE_STACKCHECK on macOS#8046

Closed
corona10 wants to merge 7 commits into
python:masterpython/cpython:masterfrom
corona10:bpo-33955corona10/cpython:bpo-33955Copy head branch name to clipboard
Closed

bpo-33955: Support USE_STACKCHECK on macOS#8046
corona10 wants to merge 7 commits into
python:masterpython/cpython:masterfrom
corona10:bpo-33955corona10/cpython:bpo-33955Copy head branch name to clipboard

Conversation

@corona10

@corona10 corona10 commented Jul 2, 2018

Copy link
Copy Markdown
Member

@corona10 corona10 changed the title bpo-33955: Support USE_STACKCHECK on Mac OS bpo-33955: [WIP] Support USE_STACKCHECK on Mac OS Jul 2, 2018

@ronaldoussoren ronaldoussoren left a comment

Copy link
Copy Markdown
Contributor

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).

@bedevere-bot

Copy link
Copy Markdown

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@corona10

corona10 commented Jul 2, 2018

Copy link
Copy Markdown
Member Author

@ronaldoussoren

Thank you for a quick review.
I will add a new test soon!
Thanks!

@corona10 corona10 changed the title bpo-33955: [WIP] Support USE_STACKCHECK on Mac OS bpo-33955: Support USE_STACKCHECK on Mac OS Jul 2, 2018
@corona10 corona10 changed the title bpo-33955: Support USE_STACKCHECK on Mac OS bpo-33955: Support USE_STACKCHECK on macOS Jul 2, 2018
@corona10 corona10 changed the title bpo-33955: Support USE_STACKCHECK on macOS bpo-33955: [WIP] Support USE_STACKCHECK on macOS Jul 2, 2018
@corona10 corona10 force-pushed the bpo-33955 branch 3 times, most recently from 148001b to 4be8d33 Compare July 2, 2018 18:54
@corona10

corona10 commented Jul 2, 2018

Copy link
Copy Markdown
Member Author

@ronaldoussoren

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.
Although I added this test on test_sys.py both Windows and macOS is failed on the CI except my local.
Is there any reference that I didn't catch?

@corona10 corona10 changed the title bpo-33955: [WIP] Support USE_STACKCHECK on macOS bpo-33955: Support USE_STACKCHECK on macOS Jul 2, 2018
@corona10 corona10 changed the title bpo-33955: Support USE_STACKCHECK on macOS bpo-33955: [WIP] Support USE_STACKCHECK on macOS Jul 2, 2018
@corona10

corona10 commented Jul 2, 2018

Copy link
Copy Markdown
Member Author

@ronaldoussoren
Hmm maybe, I can add a new test on test_sys.py.
I will try it soon.

I added a logic for estimating a new stack space by using the stack space that was just needed.

@corona10 corona10 force-pushed the bpo-33955 branch 2 times, most recently from b5e933f to 138eba1 Compare July 5, 2018 03:50
@corona10 corona10 changed the title bpo-33955: [WIP] Support USE_STACKCHECK on macOS bpo-33955: Support USE_STACKCHECK on macOS Jul 5, 2018
@corona10 corona10 force-pushed the bpo-33955 branch 5 times, most recently from ada28bf to 181fa6e Compare July 5, 2018 05:05
Comment thread Python/pythonrun.c Outdated
Comment thread Python/pythonrun.c Outdated
Comment thread Python/pythonrun.c Outdated
@corona10 corona10 changed the title bpo-33955: Support USE_STACKCHECK on macOS [WIP] bpo-33955: Support USE_STACKCHECK on macOS Dec 17, 2019
@corona10 corona10 changed the title [WIP] bpo-33955: Support USE_STACKCHECK on macOS bpo-33955: Support USE_STACKCHECK on macOS Dec 17, 2019
@corona10 corona10 force-pushed the bpo-33955 branch 2 times, most recently from d1919f5 to 131dfee Compare December 17, 2019 15:52
@corona10

corona10 commented Dec 17, 2019

Copy link
Copy Markdown
Member Author

@vstinner cc @ronaldoussoren

Thank you for the kind review and thank you for the guide about how to use ThreadState.

  • Change the store area about stack size tracing into ThreadState for TLS purpose, not ThreadState->interp.
  • There is an API that can change the stack size, but it will apply to the newly created thread. Should we care about it? threading.stack_size
  • So I locally run the script with threading and it works well.

@corona10

corona10 commented Dec 17, 2019

Copy link
Copy Markdown
Member Author

Sorry, I found an issue with this PR.
I will ping you after this issue is resolved.

@corona10

Copy link
Copy Markdown
Member Author

@vstinner
Sorry for the verbose message.
The issue was not related to this PR.
After make clean it works well on my local machine.
Please take a look when you have time.

Thanks for understanding.

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

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.

Comment thread Python/pythonrun.c Outdated
Comment thread Python/pythonrun.c Outdated
Comment thread Python/pythonrun.c Outdated
Comment thread Python/pythonrun.c Outdated
Comment thread Python/pythonrun.c Outdated
Comment thread Python/pythonrun.c Outdated
Comment thread Include/cpython/pystate.h Outdated
Comment thread Doc/whatsnew/3.9.rst Outdated
Comment thread Python/pythonrun.c Outdated

Copy link
Copy Markdown
Member

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?

Comment thread Python/pystate.c Outdated
@corona10

corona10 commented Jan 13, 2020

Copy link
Copy Markdown
Member Author

@vstinner I applied your review and some of the issues are under investigation.

List

  • Do you know if it's implemented in pure userspace, or if it's a system call?
  • Is this function available on GCC and Clang? -> clang okay, GCC is needed check
  • Honestly, I'm not super excited by the implementation. I'm not sure that it's correct. ->
    I wonder to know there is a good way to running some of the scripts that can be run by this patch.

@csabella

Copy link
Copy Markdown
Contributor

@corona10, is this still waiting changes or should it be moved back to code review? Thanks!

@corona10

Copy link
Copy Markdown
Member Author

@vstinner @ronaldoussoren Let's reopen this PR when we need this feature ;)

@corona10 corona10 closed this Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.