mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Patrick Rauscher <listen@prauscher.de>
To: musl@lists.openwall.com
Subject: [musl] ENOFILE after reaching SEM_NSEMS_MAX
Date: Mon, 08 Jan 2024 15:01:46 +0100	[thread overview]
Message-ID: <2dcdd7436bd07e0b020644fac1b3a06256db8673.camel@prauscher.de> (raw)

Hello everyone,

in POSIX, the constant SEM_NSEMS_MAX is defined as 256 from some time. While
glibc nowadays ignores the limit and will yield -1 when asked for it [1], musl
currently will return ENOFILE when asking for the 256th semaphore.

This hit me (and obviously another person) when using python multiprocessing
[2]: Jan H detected, that while allocating a large number of semaphores (or
objects using at least one semaphore) works on Debian, it fails on alpine.

Thanks to psykose on the IRC the issue could be identified to the different
libc. To make this finding less ephemeral than on the IRC log, I leave a note
here. As sem_open works in the documented way, this is certainly no bug
report, rather a feature request if you will so.

Due to my lack of C-knowledge I may only standby and marvel to further
discussion, but maybe someone can come up with ideas 🙂

Thanks for your time,
Patrick

1: https://sourceware.org/legacy-ml/libc-help/2012-02/msg00003.html
2: https://stackoverflow.com/questions/77679957/python-multiprocessing-no-file-descriptors-available-error-inside-docker-alpine


             reply	other threads:[~2024-01-08 14:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-08 14:01 Patrick Rauscher [this message]
2024-01-08 17:16 ` Markus Wichmann
2024-01-08 22:08   ` Rich Felker

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=2dcdd7436bd07e0b020644fac1b3a06256db8673.camel@prauscher.de \
    --to=listen@prauscher.de \
    --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).