Skip to content
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

Use RLIMIT_STACK's current limit for Pthreads stack size if it is sane #2852

Merged
merged 1 commit into from
Aug 8, 2018

Conversation

slfritchie
Copy link
Contributor

While investigating some strange memory-clobbering looking behavior in #2850, I discovered that macOS uses a different default Pthreads stack size than Linux does. This PR uses the RLIMIT_STACK's current limit if it is sane, i.e., if it meets the minimum size and isn't infinity.

Note that the libuv developers discovered this and have a patch that I borrowed from: libuv/libuv#669

I'm not Pthreads-savvy enough to know if it is safe to set both actual stack memory & stack size in the same attr, in the case of the Pony runtime's checking for NUMA use on Linux. I am being conservative and assuming that they should not be combined. This patch could save a few lines if it were OK to do combine them.

@slfritchie slfritchie added the changelog - changed Automatically add "Changed" CHANGELOG entry on merge label Aug 3, 2018
@slfritchie slfritchie requested a review from dipinhora August 3, 2018 15:42
@SeanTAllen SeanTAllen merged commit 5549883 into ponylang:master Aug 8, 2018
ponylang-main added a commit that referenced this pull request Aug 8, 2018
@SeanTAllen
Copy link
Member

@slfritchie can you craft release notes for this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - changed Automatically add "Changed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants