Skip to content

bpo-38852: Set thread stack size to 8 Mb for debug builds on android platforms#17337

Merged
vstinner merged 2 commits into
python:masterfrom
xdegaye:bpo-38852
Dec 8, 2019
Merged

bpo-38852: Set thread stack size to 8 Mb for debug builds on android platforms#17337
vstinner merged 2 commits into
python:masterfrom
xdegaye:bpo-38852

Conversation

@xdegaye

@xdegaye xdegaye commented Nov 22, 2019

Copy link
Copy Markdown
Contributor

Comment thread Python/thread_pthread.h
@vstinner
vstinner merged commit 00ada2c into python:master Dec 8, 2019
@vstinner

vstinner commented Dec 8, 2019

Copy link
Copy Markdown
Member

Thanks for the change. I don't understand why debug build uses 7x more stack memory, but I trust your tests https://bugs.python.org/issue38852#msg357266 :-)

@xdegaye: Do you want to backport the change to Python 3.7 and/or 3.8?

@xdegaye
xdegaye deleted the bpo-38852 branch December 8, 2019 12:24
@xdegaye

xdegaye commented Dec 8, 2019

Copy link
Copy Markdown
Contributor Author

@vstinner

I don't understand why debug build uses 7x more stack memory

In the initial post of issue https://bugs.python.org/issue18049, Ronald considers that it is the -O0 optimisation level in debug builds that causes this increase in stack memory usage. The commits that fix this issue do not use the #ifdef PY_DEBUG conditional suggested by Stéphane in the third post because, as I understand it, it is considered that "users could also build with CFLAGS set to -O0 without using --with-pydebug".

BTW in both android and OSX cases it seems that it is clang with debug builds that causes the problem. See issue https://bugs.python.org/issue14184, the initial change in stack size on OSX.

Do you want to backport the change to Python 3.7 and/or 3.8?

Since only debug builds are concerned with this change and android is not officially supported, I think backports are not necessary.

@vstinner

vstinner commented Dec 9, 2019

Copy link
Copy Markdown
Member

In the initial post of issue https://bugs.python.org/issue18049, Ronald considers that it is the -O0 optimisation level in debug builds that causes this increase in stack memory usage.

Ah yes, that makes sense.

Since only debug builds are concerned with this change and android is not officially supported, I think backports are not necessary.

Ok, I'm fine with that.

shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants