Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 16 Apr 2018 17:35:13 -0400
From: Rich Felker <dalias@...ifal.cx>
To: Justine Tunney <jart@...gle.com>
Cc: musl@...ts.openwall.com
Subject: Re: Re: musl nice() posix compliance issue

On Sun, Apr 15, 2018 at 02:58:16PM -0400, Rich Felker wrote:
> On Sun, Apr 15, 2018 at 10:17:37AM -0700, Justine Tunney wrote:
> > According to Python 2.7 autoconf, musl's nice() function needs to do this.
> > I checked latest release and HEAD.
> > 
> >    C library/kernel differences
> >        POSIX.1 specifies that nice() should return the new nice value.
> > However, the raw Linux system call returns 0 on success.  Likewise, the
> > nice() wrapper function provided in glibc 2.2.3 and
> >        earlier returns 0 on success.
> 
> This analysis seems correct, and from what I can tell, the SYS_nice
> syscall simply isn't usable to implement nice() because it doesn't
> provide the resulting nice level. So I think we have to fully drop use
> of it. OTOH SYS_get/setpriority are also problematic because of
> non-atomicity; we can and probably should try to patch that up by
> blocking signals and taking a lock around the operation -- but I'm not
> sure Linux even correctly applies the priority to all threads rather
> than just the calling thread, anyway... Do you know?

It doesn't, but this is a separate bug that can be worked around on
its own. I'll apply a fix for the part you reported first.

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.