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

bpo-46606: Reduce stack usage of getgroups and setgroups #31073

Merged
merged 1 commit into from
Feb 22, 2022

Conversation

methane
Copy link
Member

@methane methane commented Feb 2, 2022

NGROUPS_MAX was 32 before Linux 2.6.4 but 65536 since Linux 2.6.4.

This reduce stack usage more than 200KB. It means less risk of C stackoverflow.

https://bugs.python.org/issue46606

NGROUPS_MAX was 32 before Linux 2.6.4 but 65536 since Linux 2.6.4.
@sweeneyde
Copy link
Member

Looks like this logic is from 1999!

#define MAX_GROUPS NGROUPS_MAX

Operating systems seem to have dramatically increased NGROUPS_MAX since then: https://www.j3e.de/ngroups.html

@methane methane merged commit 74127b8 into python:main Feb 22, 2022
@methane methane deleted the getsetgroups branch February 22, 2022 02:59
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.

4 participants