bash "kill -l" builtin gives wrong numbers for SIGRTMIN+n signals

Bug #1433155 reported by Ruslan
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The command "grep SIGRTMIN /usr/include/ -r" gives me

/usr/include/asm/signal.h:#define SIGRTMIN 32

and a bunch of other defines with the same value. But if I ask bash's "kill" builtin via "kill -l", I get "34) SIGRTMIN". What's interesting, there's actually no number 32 listed at all. Number 34 goes right after 31, where the right 32 should appear. The other names defined via SIGRTMIN are also wrong.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: bash 4.2-2ubuntu2.6
ProcVersionSignature: Ubuntu 3.2.0-76.111-generic 3.2.66
Uname: Linux 3.2.0-76-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu17.6
Architecture: amd64
Date: Tue Mar 17 18:34:25 2015
InstallationMedia: Kubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120423)
MarkForUpload: True
ProcEnviron:
 LANGUAGE=
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: bash
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ruslan (b7-10110111) wrote :
Revision history for this message
John Samuel (johnsamuel) wrote :

On executing the following command

$ grep SIGRTMIN /usr/include/ -r
/usr/include/asm-generic/signal.h:#define SIGRTMIN 32
/usr/include/x86_64-linux-gnu/asm/signal.h:#define SIGRTMIN 32
/usr/include/x86_64-linux-gnu/bits/signum.h:#define SIGRTMIN (__libc_current_sigrtmin ())
/usr/include/x86_64-linux-gnu/bits/signum.h:#define __SIGRTMIN 32

and checking the source code of glibc-2.19/signal/allocrtsig.c
...
/* Return number of available real-time signal with highest priority. */
int
__libc_current_sigrtmin (void)
{
#ifdef __SIGRTMIN
  if (!initialized)
    init ();
#endif
  return current_rtmin;
}
...

It seems that bash uses the value of current_rtmin

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bash (Ubuntu):
status: New → Confirmed
Revision history for this message
Explorer09 (explorer09) wrote :

This is not a bug! It's expected behavior!
The SIGRTMIN number you quoted from /usr/include/asm/signal.h is a kernel minimum number of real-time signal, which is usually used by pthread library and not available for user apps.

Both of these two Stack Exchange questions have explained this:

http://unix.stackexchange.com/questions/155829/why-does-kill-l-not-list-signal-numbers-of-32-and-33
http://stackoverflow.com/questions/12680624/what-has-happened-to-the-32-and-33-kill-signals

Now, should this "bug" be closed?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.