mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: musl@lists.openwall.com, Norbert Lange <nolange79@gmail.com>
Subject: Re: [musl] [BUG] sysconf implementing _SC_NPROCESSORS_(CONF|ONLN) incorrectly
Date: Thu, 9 Apr 2020 21:02:55 -0400	[thread overview]
Message-ID: <20200410010255.GN11469@brightrain.aerifal.cx> (raw)
In-Reply-To: <87r1wwik8t.fsf@mid.deneb.enyo.de>

On Thu, Apr 09, 2020 at 08:31:30PM +0200, Florian Weimer wrote:
> * Szabolcs Nagy:
> 
> > * Norbert Lange <nolange79@gmail.com> [2020-04-09 12:29:20 +0200]:
> >> Hello,
> >> 
> >> I ran into a bug with trace-cmd when compiled against musl.
> >> Turns out musl just returns the affinity mask in both cases.
> >> 
> >> I know those functions are not standard, but the irony is that if they
> >> are implemented,
> >> then they prevent applications to use fallbacks.
> >> 
> >> See the trace-cmd bugreport:
> >> https://bugzilla.kernel.org/show_bug.cgi?id=206817
> >
> > i think there are open unanswered questions about the right
> > semantics it's not clear what user code may expect
> >
> > https://www.openwall.com/lists/musl/2019/03/16/1
> > https://www.openwall.com/lists/musl/2019/03/19/1
> 
> Stille, returning 1 if the sched_getaffinity system call fails
> (because the affinity mask is unexpectedly large) will break some
> software that assumes a true uniprocessor system if the processor
> count is zero.  (OpenJDK is an example.)
> 
> This can also happen if there is some external affinity mask manager.
> 
> For glibc, we had to change our logic to artificially inflate the CPU
> to 2 if we cannot determine it, as the more conservative choice.

Wait, you mean some software is abusing these interfaces to omit
memory barriers or something? *facepalm* *sigh*

Yes, we should probably do something better to implement these but I'm
not sure what.

Rich

  reply	other threads:[~2020-04-10  1:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 10:29 Norbert Lange
2020-04-09 18:18 ` Szabolcs Nagy
2020-04-09 18:31   ` Florian Weimer
2020-04-10  1:02     ` Rich Felker [this message]
2020-04-14 10:08       ` Florian Weimer
2020-04-14 15:55         ` Rich Felker
2020-04-14 16:55           ` Florian Weimer
2020-04-15  9:38             ` Norbert Lange
2020-04-15  9:50               ` Florian Weimer
2020-04-15  9:57                 ` Norbert Lange
2020-04-15 10:04                   ` Szabolcs Nagy
2020-04-15 16:01                     ` Rich Felker
2020-04-15 15:58                 ` 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=20200410010255.GN11469@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=fw@deneb.enyo.de \
    --cc=musl@lists.openwall.com \
    --cc=nolange79@gmail.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).