Debian Bug report logs -
#44039
libc0.3: nice changes priority of parent shell
Reported by: Marcus.Brinkmann@ruhr-uni-bochum.de
Date: Fri, 3 Sep 1999 03:33:01 UTC
Severity: normal
Done: Samuel Thibault <sthibault@debian.org>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, GNU Hurd Maintainers <bug-hurd@gnu.org>:
Bug#44039; Package hurd.
(full text, mbox, link).
Acknowledgement sent to Marcus.Brinkmann@ruhr-uni-bochum.de:
New bug report received and forwarded. Copy sent to GNU Hurd Maintainers <bug-hurd@gnu.org>.
(full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: hurd
Version: N/A
Severity: normal
Hello,
$ nice
0
$ nice echo Hi!
Hi!
$ nice
10
This is not what I expect (and get under Linux). I would expect the "echo"
command to run with priority 10, but not change the priority of the current
shell. Is this a bug or a limitation of the current implementation?
(I will try to provide more info / isolate a C program later, if necessary)
Thanks,
Marcus
-- System Information
Debian Release: potato
Kernel Version: Linux ulysses 2.2.10-ac9 #1 Mit Jul 14 01:43:01 CEST 1999 i586 unknown
Information forwarded to debian-bugs-dist@lists.debian.org, GNU Hurd Maintainers <bug-hurd@gnu.org>:
Bug#44039; Package hurd.
(full text, mbox, link).
Acknowledgement sent to Mike Kienenberger <mkienenb@alaska.net>:
Extra info received and forwarded to list. Copy sent to GNU Hurd Maintainers <bug-hurd@gnu.org>.
(full text, mbox, link).
Message #10 received at 44039@bugs.debian.org (full text, mbox, reply):
Marcus.Brinkmann@ruhr-uni-bochum.de wrote:
> Package: hurd
> Version: N/A
> Severity: normal
>
> Hello,
>
> $ nice
> 0
> $ nice echo Hi!
> Hi!
> $ nice
> 10
>
> This is not what I expect (and get under Linux). I would expect the "echo"
> command to run with priority 10, but not change the priority of the current
> shell. Is this a bug or a limitation of the current implementation?
>
> (I will try to provide more info / isolate a C program later, if necessary)
Depending on your shell, echo might be a built-in command of that shell.
The operation of "nice" on a built-in is probably undefined (do nothing? or
nice the shell instead?)
Try using "nice /bin/echo Hi!" and see if that makes a difference.
-Mike Kienenberger
mkienenb@alaska.net
Information forwarded to debian-bugs-dist@lists.debian.org, GNU Hurd Maintainers <bug-hurd@gnu.org>:
Bug#44039; Package hurd.
(full text, mbox, link).
Acknowledgement sent to Roland McGrath <roland@gnu.org>:
Extra info received and forwarded to list. Copy sent to GNU Hurd Maintainers <bug-hurd@gnu.org>.
(full text, mbox, link).
Message #15 received at 44039@bugs.debian.org (full text, mbox, reply):
Let me know what effect this libc patch has on that:
1999-09-05 Roland McGrath <roland@baalperazim.frob.com>
* hurd/hurdprio.c (_hurd_priority_which_map): If WHO is zero default
it to getpid () for PRIO_PROCESS, geteuid () for PRIO_USER.
Index: hurdprio.c
===================================================================
RCS file: /glibc/cvsfiles/libc/hurd/hurdprio.c,v
retrieving revision 1.7.2.1
diff -u -b -p -r1.7.2.1 hurdprio.c
--- hurdprio.c 1999/07/26 23:27:02 1.7.2.1
+++ hurdprio.c 1999/09/05 08:41:56
@@ -36,7 +36,7 @@ _hurd_priority_which_map (enum __priorit
{
case PRIO_PROCESS:
npids = 1;
- pids[0] = who;
+ pids[0] = who ?: getpid (); /* XXX function could special-case self? */
err = 0;
break;
@@ -45,6 +45,8 @@ _hurd_priority_which_map (enum __priorit
break;
case PRIO_USER:
+ if (who == 0)
+ who = geteuid ();
err = __USEPORT (PROC, __proc_getallpids (port, &pids, &npids));
break;
Information forwarded to debian-bugs-dist@lists.debian.org, GNU Hurd Maintainers <bug-hurd@gnu.org>:
Bug#44039; Package hurd.
(full text, mbox, link).
Acknowledgement sent to Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>:
Extra info received and forwarded to list. Copy sent to GNU Hurd Maintainers <bug-hurd@gnu.org>.
(full text, mbox, link).
Message #20 received at 44039@bugs.debian.org (full text, mbox, reply):
On Sun, Sep 05, 1999 at 04:42:34AM -0400, Roland McGrath wrote:
> Let me know what effect this libc patch has on that:
>
> * hurd/hurdprio.c (_hurd_priority_which_map): If WHO is zero default
> it to getpid () for PRIO_PROCESS, geteuid () for PRIO_USER.
It's better now. "nice command" does only change the priority of the child
process when run as root.
There is another problem now that nice/renice returns a bogus error message
if you try to lower the priority below 0. The error message is bogus because
the priority is indeed set, as the below transcript proves.
Another minor nit are the following warnings:
hurdprio.c: In function `_hurd_priority_which_map':
hurdprio.c:39: warning: implicit declaration of function `getpid'
hurdprio.c:49: warning: implicit declaration of function `geteuid'
Here is the script:
Script started on Mon Sep 6 04:15:57 1999
hurd:/tests# renice 0 150
150: old priority 0, new priority 0
hurd:/tests# renice 10 150
150: old priority 0, new priority 10
hurd:/tests# renice 20 150
150: old priority 10, new priority 20
hurd:/tests# renice 30 150
150: old priority 20, new priority 20
Mmmh. Okay. Raising priority up to 20 works.
hurd:/tests# renice 0 150
150: old priority 20, new priority 0
hurd:/tests# renice -10 150
renice: 150: setpriority: Permission denied
Hu?
hurd:/tests# renice 0 150
150: old priority -10, new priority 0
Ah! It did change the priority, but anyway gave a bogus error.
hurd:/tests# renice -20 150
renice: 150: setpriority: Permission denied
hurd:/tests# renice 0 150
150: old priority -20, new priority 0
Again.
hurd:/tests# renice -30 150
renice: 150: setpriority: Permission denied
hurd:/tests# renice 0 150
150: old priority -20, new priority 0
Okay, lower border is honoured.
Thanks,
Marcus
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org Check Key server
Marcus Brinkmann GNU http://www.gnu.org for public PGP Key
Marcus.Brinkmann@ruhr-uni-bochum.de PGP Key ID 36E7CD09
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/
Information forwarded to debian-bugs-dist@lists.debian.org, GNU Hurd Maintainers <bug-hurd@gnu.org>:
Bug#44039; Package hurd.
(full text, mbox, link).
Acknowledgement sent to Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>:
Extra info received and forwarded to list. Copy sent to GNU Hurd Maintainers <bug-hurd@gnu.org>.
(full text, mbox, link).
Message #25 received at 44039@bugs.debian.org (full text, mbox, reply):
On Mon, Sep 06, 1999 at 04:25:42AM +0200, Marcus Brinkmann wrote:
> On Sun, Sep 05, 1999 at 04:42:34AM -0400, Roland McGrath wrote:
> > Let me know what effect this libc patch has on that:
> >
> > * hurd/hurdprio.c (_hurd_priority_which_map): If WHO is zero default
> > it to getpid () for PRIO_PROCESS, geteuid () for PRIO_USER.
>
> It's better now. "nice command" does only change the priority of the child
> process when run as root.
>
> There is another problem now that nice/renice returns a bogus error message
> if you try to lower the priority below 0. The error message is bogus because
> the priority is indeed set, as the below transcript proves.
The transcript doesn't show the full truth. The priority of the task is set,
but not of the individual threads. The reason is the following check in
thread_priority (gnumach/kern/task.c):
/*
* Check for violation of max priority
*/
if (priority < thread->max_priority) {
ret = KERN_FAILURE;
}
We need to adjust the max_priority. It might be possible to change the
max_priority to the lowest value at task creation time, not in the kernel,
but in the Hurd servers / GLibC, whereever tasks are created.
Or maybe we can call thread_max_priority in libc/sysdeps/mach/hurd.c, or
something like that. There is also threads_set_own_priority, which might be
useful.
Marcus
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann GNU http://www.gnu.org marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de
Information forwarded to debian-bugs-dist@lists.debian.org, GNU Hurd Maintainers <bug-hurd@gnu.org>:
Bug#44039; Package hurd.
(full text, mbox, link).
Acknowledgement sent to Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>:
Extra info received and forwarded to list. Copy sent to GNU Hurd Maintainers <bug-hurd@gnu.org>.
(full text, mbox, link).
Message #30 received at 44039@bugs.debian.org (full text, mbox, reply):
Hi,
the implementation of setpriority is broken, as it doesn't allow the super
user to lower the priority of the task *and all threads it contains* below
the current minimal priority of the threads/processor set (I am liberally
mixing POSIX priorities with Mach concepts here). Also, it reports the
tasks priority, but this is not the acutal or enforced priority (for
example, a normal user can lower the priority of a task to -10, but willg et
an error, and indeed the threads won't have the desired priority).
This needs more work. Of course, we only need to give a consistent view in
the POSIX world if the user doesn't use Mach calls directly. I suggest that
if task_priority fails, it is called again with the old priority to make
the getpriority report the correct value.
If the user is the superuser, he can request the processor set ports and use
that to set the threads max (for POSIX: min) priority.
All this ignores the max priority of processor sets, this is something I
haven't checked yet. It seems to me we should set the processor sets max
priority to the highest value by default.
Actually, I haven't really spent too much thought on this, maybe someone can
investigate the remaining details and develop patches for glibc (and maybe
proc, which would set the processor sets priorities, I think).
If the Mach picture is not good enough, we might save the priority of a
task/thread in proc. From a first glance, I don't think that it is needed.
Thanks,
Marcus
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann GNU http://www.gnu.org marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de
Information forwarded to debian-bugs-dist@lists.debian.org, GNU Hurd Maintainers <bug-hurd@gnu.org>, hurd@packages.qa.debian.org:
Bug#44039; Package hurd.
(full text, mbox, link).
Acknowledgement sent to Robert Millan <zeratul2@wanadoo.es>:
Extra info received and forwarded to list. Copy sent to GNU Hurd Maintainers <bug-hurd@gnu.org>, hurd@packages.qa.debian.org.
(full text, mbox, link).
Message #35 received at 44039@bugs.debian.org (full text, mbox, reply):
reassign 44039 libc0.3
retitle 44039 libc0.3: nice changes priority of parent shell
thanks
On Fri, Apr 25, 2003 at 10:19:17AM -0700, Jeff Bailey wrote:
> On Fri, Apr 25, 2003 at 06:03:35PM +0200, Robert Millan wrote:
>
> > I checked the libc0.3 bug list before reporting. what is a libc0.3 bug doing in the hurd package?
>
> We've been sloppy in the past about how things were assigned - Generally
> if it was a Hurd-specific bug it went into the Hurd package,
> since the Hurd maintainers were looking there, and not in the
> glibc bugs.
I see.. well gnumach, hurd and libc0.3 are part of the same system but
we should have sorted their respective bugs.
Glibc maintainers: bug #44039 is not exactly the same as #190581, so
i'm not merging. i'd say that #44039 is a "multibug" that contains a patch
which fixes #190581, but doesn't fix all the bugs in #44039
> Feel free to reassign it.
done.
--
Robert Millan
make: *** No rule to make target `war'. Stop.
Another world is possible - Just say no to genocide
Bug reassigned from package `hurd' to `libc0.3'.
Request was from Robert Millan <zeratul2@wanadoo.es>
to control@bugs.debian.org.
(full text, mbox, link).
Changed Bug title.
Request was from Robert Millan <zeratul2@wanadoo.es>
to control@bugs.debian.org.
(full text, mbox, link).
Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#44039; Package libc0.3.
(full text, mbox, link).
Acknowledgement sent to Aurelien Jarno <aurelien@aurel32.net>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>.
(full text, mbox, link).
Message #44 received at 44039@bugs.debian.org (full text, mbox, reply):
Hi,
The nice() code glibc seems to have changed a lot in the glibc since
these two bugs have been reported. Could you (or somebody from
debian-hurd), please give a try to see if the problem is still there?
Thanks,
Aurelien
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
Information forwarded to debian-bugs-dist@lists.debian.org, GNU Libc Maintainers <debian-glibc@lists.debian.org>:
Bug#44039; Package libc0.3.
(full text, mbox, link).
Acknowledgement sent to Michael Banck <mbanck@debian.org>:
Extra info received and forwarded to list. Copy sent to GNU Libc Maintainers <debian-glibc@lists.debian.org>.
(full text, mbox, link).
Message #49 received at 44039@bugs.debian.org (full text, mbox, reply):
On Sat, Feb 18, 2006 at 11:41:05PM +0100, Aurelien Jarno wrote:
> The nice() code glibc seems to have changed a lot in the glibc since
> these two bugs have been reported. Could you (or somebody from
> debian-hurd), please give a try to see if the problem is still there?
I think it is still there.
Michael
--
Michael Banck
Debian Developer
mbanck@debian.org
http://www.advogato.org/person/mbanck/diary.html
Reply sent
to Samuel Thibault <sthibault@debian.org>:
You have taken responsibility.
(Tue, 19 Aug 2014 21:45:11 GMT) (full text, mbox, link).
Notification sent
to Marcus.Brinkmann@ruhr-uni-bochum.de:
Bug acknowledged by developer.
(Tue, 19 Aug 2014 21:45:11 GMT) (full text, mbox, link).
Message #54 received at 44039-done@bugs.debian.org (full text, mbox, reply):
Marcus.Brinkmann@ruhr-uni-bochum.de, le Fri 03 Sep 1999 05:06:31 +0200, a écrit :
> $ nice
> 0
> $ nice echo Hi!
> Hi!
> $ nice
> 10
This was fixed at some point, it doesn't happen any more.
Samuel
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Wed, 17 Sep 2014 07:30:27 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Wed Dec 6 12:57:30 2023;
Machine Name:
bembo
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.