View Issue Details

IDProjectCategoryView StatusLast Update
00009651003.1(2013)/Issue7+TC1Shell and Utilitiespublic2015-06-29 14:21
ReporterRalph Corderoy Assigned To 
PrioritynormalSeverityCommentTypeClarification Requested
Status ClosedResolutionWithdrawn 
NameRalph Corderoy
Organization
User Reference
Sectionkill
Page Number(page or range of pages)
Line Number(Line or range of lines)
Interp Status---
Final Accepted Text
Summary0000965: kill(1) doesn't specify processing order of PIDs
Descriptionkill(1) doesn't state the order that the given process IDs are signalled.
One might reasonably assume left to right. 7th Ed. did this, BSD and many others do. But kill from Debian's procps runs right to left on this system.

/bin/kill from procps:

    $ l=; for n in _ _ _; do sleep 42 & l="$l $!"; done; set -x; strace -e kill kill $l; set +x
    + strace -e kill kill 24882 24883 24884
    kill(24884, SIGTERM) = 0
    kill(24883, SIGTERM) = 0
    kill(24882, SIGTERM) = 0
    + set +x

bash's built-in for comparison:

    $ l=; for n in _ _ _; do sleep 42 & l="$l $!"; done; set -x; strace -e kill bash -c "kill $l"; set +x
    + strace -e kill bash -c 'kill 24887 24888 24889'
    kill(24887, SIGTERM) = 0
    kill(24888, SIGTERM) = 0
    kill(24889, SIGTERM) = 0
    + set +x
    $
Desired ActionThe man page should ideally state the left to right order as a requirement, as it's widespread and long standing. Or if not, it should make clear the order is undefined.
TagsNo tags attached.

Activities

geoffclare

2015-06-29 08:34

manager   bugnote:0002735

The standard requires kill to process its pid operands in command line order. See XCU 1.4 Utility Description Defaults, under OPERANDS:

"Unless otherwise stated, the standard utilities that accept operands shall process those operands in the order specified in the command line."

Since nothing in the description of kill says it need not follow this general rule, it is required to do so.

Ralph Corderoy

2015-06-29 11:32

reporter   bugnote:0002736

Thanks for the reference Geoff. Sorry for the noise. I would change the Resolution from Open to Closed, or similar, but looks like that needs greater authority.

geoffclare

2015-06-29 14:21

manager   bugnote:0002737

Closing as withdrawn, based on 0000965:0002736.

Issue History

Date Modified Username Field Change
2015-06-28 12:52 Ralph Corderoy New Issue
2015-06-28 12:52 Ralph Corderoy Name => Ralph Corderoy
2015-06-28 12:52 Ralph Corderoy Section => kill
2015-06-28 12:52 Ralph Corderoy Page Number => (page or range of pages)
2015-06-28 12:52 Ralph Corderoy Line Number => (Line or range of lines)
2015-06-29 08:34 geoffclare Note Added: 0002735
2015-06-29 11:32 Ralph Corderoy Note Added: 0002736
2015-06-29 14:21 geoffclare Interp Status => ---
2015-06-29 14:21 geoffclare Note Added: 0002737
2015-06-29 14:21 geoffclare Status New => Closed
2015-06-29 14:21 geoffclare Resolution Open => Withdrawn