Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tests/thread/thread_stacksize1.py: increase stack size for cpython #5996

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

Closed
wants to merge 1 commit into from
Closed

tests/thread/thread_stacksize1.py: increase stack size for cpython #5996

wants to merge 1 commit into from

Conversation

yangfl
Copy link
Contributor

@yangfl yangfl commented May 1, 2020

On arm64

_thread.stack_size(32*1024)
Traceback (most recent call last):
File "", line 1, in
ValueError: size not valid: 32768 bytes

Increase to 512k since on modern Linux, the default stack size is usually 8MB.

On arm64

  >>> _thread.stack_size(32*1024)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  ValueError: size not valid: 32768 bytes

Increase to 512k since on modern Linux, the default stack size is usually 8MB.
@dlech
Copy link
Contributor

dlech commented May 1, 2020

FWIW, I proposed a similar change originally in #5784 but we found other ways to deal with it.

@dlech
Copy link
Contributor

dlech commented May 1, 2020

I'm guessing the error you quoted is from CPython?

@dlech
Copy link
Contributor

dlech commented May 1, 2020

Relevant code in CPython:

https://github.com/python/cpython/blob/81a7be3fa22c983209cc0ffb3537b92b0370f83c/Python/thread_pthread.h#L743-L745

Google search says that PTHREAD_STACK_MIN is "huge" on AArch64 since it can have 64k page size.

@dpgeorge
Copy link
Member

dpgeorge commented May 3, 2020

FWIW, I proposed a similar change originally in #5784 but we found other ways to deal with it.

@dlech I think your change there changed the stack size when running MicroPython, not CPython, right? It looks like the issue here is when running on CPython.

This change looks OK to me because it doesn't affect how the test behaves on CPython, and doesn't affect it at all when it runs on MicroPython.

@dpgeorge dpgeorge added the tests Relates to tests/ directory in source label May 3, 2020
@dlech
Copy link
Contributor

dlech commented May 3, 2020

Yes, I didn't realize that this was dealing with CPython only at first glance.

@dpgeorge
Copy link
Member

dpgeorge commented May 4, 2020

Thanks for the patch! Merged in 138a28d

@dpgeorge dpgeorge closed this May 4, 2020
tannewt added a commit to tannewt/circuitpython that referenced this pull request Feb 10, 2022
WiFi Monitor: improve channel validation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Relates to tests/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants