From: "Laurent Bercot" <ska-dietlibc@skarnet.org>
To: musl@lists.openwall.com
Subject: Re: [musl] [PATCH] Increase NGROUPS_MAX from 32 to 1024
Date: Thu, 11 Apr 2024 11:44:16 +0000 [thread overview]
Message-ID: <emda7fe876-df00-48b8-88e5-68bddf86b789@a532f72a.com> (raw)
In-Reply-To: <ZhdR6Cl386bK454k@voyager>
>I had a look at Debian Codesearch for NGROUPS_MAX, to see what
>applications are actually doing with the macro. And I found no instance
>of anyone using it as an array size.
I do. e.g.
https://git.skarnet.org/cgi-bin/cgit.cgi/s6/tree/src/daemontools-extras/s6-applyuidgid.c#n22
It's in small short-lived utilities that don't allocate anything, so
I'm
not too worried about overflowing the stack, but the change would not be
friendly to resource-constrained environments.
My code runs on not-so-conformant systems such as Solaris or MacOS,
where
I'm not sure that sysconf() and _SC_NGROUPS_MAX are even defined and
correct.
I can test, but that's more work, and convoluted heuristics to make
things
support every case are a strong decrease in readability and reliability,
an additional portability nightmare I don't want to deal with. Whereas
NGROUPS_MAX works everywhere.
I'm not sure what the best course of action is. I think it still
probably
is eating the ephemeral 256kB stack penalty if NGROUPS_MAX is increased
to 65536.
--
Laurent
prev parent reply other threads:[~2024-04-11 11:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 23:35 Kate Deplaix
2024-03-11 18:31 ` [musl] " Kate Deplaix
2024-03-12 0:46 ` Rich Felker
2024-04-09 12:54 ` Kate Deplaix
2024-04-09 15:46 ` Thorsten Glaser
2024-04-09 16:26 ` Rich Felker
2024-04-11 1:07 ` [musl] " Rich Felker
2024-04-11 1:51 ` Rich Felker
2024-04-11 2:58 ` Markus Wichmann
2024-04-11 11:44 ` Laurent Bercot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=emda7fe876-df00-48b8-88e5-68bddf86b789@a532f72a.com \
--to=ska-dietlibc@skarnet.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).