RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 846790 - missing information about threads in kill(2) man page
Summary: missing information about threads in kill(2) man page
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: util-linux-ng
Version: 6.3
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-08 17:54 UTC by David Tonhofer
Modified: 2013-11-21 20:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Feature: The kill(1) man page has been improved to explicitly explain interaction between kill syscall and threads. Reason: It wasn't obvious to users how kill(1) works with threads. Result (if any):
Clone Of:
Environment:
Last Closed: 2013-11-21 20:43:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1648 0 normal SHIPPED_LIVE util-linux-ng bug fix and enhancement update 2013-11-20 21:53:24 UTC

Description David Tonhofer 2012-08-08 17:54:16 UTC
Description of problem:
=======================

A little question on the usage of kill(2) I have run into:

I have scripts that check whether a process is alive by getting a known pidfile,
then issuing a "kill -o PID" to the PID contained in that pidfile. This is a standard trick of course.

However, it seems that nowadays "kill -o PID" also sends signals to threads, i.e. if there is no PID, the value is assumed to be a TID and the thread is signalled (I suppose, it probably just signals whatever is in the process table at the given ID)

This does not conform to the specification. Consider /bin/kill:

- An strace of kill(1) shows a call to the kill(2) syscall but:
- The kill(2) manpage doesn't mention threads at all.
- Indeed, there is a specially designed tgkill(2) to signal threads.
- The manpage of tgkill says; "By contrast, kill(2) can only be used to send a
  signal to a process (i.e., thread group) as a whole, and the signal will be
  delivered to an arbitrary thread within that process.)"

Now: 

Should kill(1) not check whether the pid it is given belongs to a thread or a process and, in case of a thread id, simply refuse to send a signal ("kill can only be used to send a signal to a process")

Shouldn't there be a tgkill(1) ?

Or else, shouldn't the manpage be changed?





So either the kill(2) manpage and the tgkill(2) are wrong / need to be
completed or there is an implementation problem with the kill syscall.

Comment 11 errata-xmlrpc 2013-11-21 20:43:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1648.html


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