Skip to content

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

Merged
methane merged 1 commit into
python:mainfrom
methane:getsetgroups
Feb 22, 2022
Merged

bpo-46606: Reduce stack usage of getgroups and setgroups#31073
methane merged 1 commit into
python:mainfrom
methane:getsetgroups

Conversation

@methane
Copy link
Copy Markdown
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
Copy Markdown
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