This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 680903 - incorrect real time signals
incorrect real time signals
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: strace (Show other bugs)
14
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Roland McGrath
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-28 07:24 EST by Karel Zak
Modified: 2011-02-28 08:34 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-02-28 08:34:18 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Karel Zak 2011-02-28 07:24:10 EST
Description of problem:

strace(1) incorrectly translates the second kill(2) argument from signal number to SIGRT_<N> if the argument is real-time signal.

For example the following code uses SIGRTMIN+10, but strace(1) prints SIGRT_12:

---
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>

int main(int argc, char **argv)
{
        return kill(atoi(argv[1]), SIGRTMIN + 10);
}
---

$ sleep 1000 &                                                                               [1] 9192

$ strace -e kill ./a  9192 
kill(9192, SIGRT_12)                    = 0
           ^^^^^^^^

[1]+  Real-time signal 10     sleep 1000
Comment 1 Dmitry V. Levin 2011-02-28 08:34:18 EST
$ cat s.c
#include <stdio.h>
#include <unistd.h>
#include <signal.h>

int main(void)
{
	printf("SIGRTMIN=%d, __SIGRTMIN=%d\n", SIGRTMIN, __SIGRTMIN);
        return kill(getpid(), SIGRTMIN + 10);
}

$ strace -ekill ./s
SIGRTMIN=34, __SIGRTMIN=32
kill(13589, SIGRT_12)                   = 0
--- SIGRT_12 (Real-time signal 10) @ 0 (0) ---
+++ killed by SIGRT_12 +++
Real-time signal 10

Note that SIGRTMIN != __SIGRTMIN.
The first is defined by glibc, the latter is defined by kernel headers.
This difference is documented in signal(7).

There should be no surprise that strace prints kernel constants while strsignal(3) prints glibc constants.

Note You need to log in before you can comment on or make changes to this bug.