Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200410010255.GN11469@brightrain.aerifal.cx>
Date: Thu, 9 Apr 2020 21:02:55 -0400
From: Rich Felker <dalias@...c.org>
To: Florian Weimer <fw@...eb.enyo.de>
Cc: musl@...ts.openwall.com, Norbert Lange <nolange79@...il.com>
Subject: Re: [BUG] sysconf implementing _SC_NPROCESSORS_(CONF|ONLN)
 incorrectly

On Thu, Apr 09, 2020 at 08:31:30PM +0200, Florian Weimer wrote:
> * Szabolcs Nagy:
> 
> > * Norbert Lange <nolange79@...il.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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.