Project

General

Profile

Actions

Bug #14592

closed

pwait(1) should never wait on its own PID

Added by Dan McDonald 5 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Related to #11828 , this issue tracks the bad behavior that inspired 11828.

The pid of pwait(1) itself should NEVER be waited upon. Pid needs to ignore its own PID whenever it appears on the command line. The -v option should emit output when its-own-pid occurs.


Files

14592.c (199 Bytes) 14592.c Spencer Evans-Cole, 2022-04-04 11:28 PM

Related issues

Blocks illumos gate - Feature #11828: pwait(1) should have feature to avoid its own ptreeNewSpencer Evans-Cole

Actions
Actions #1

Updated by Dan McDonald 5 months ago

  • Blocks Feature #11828: pwait(1) should have feature to avoid its own ptree added
Actions #2

Updated by Electric Monk 5 months ago

  • Gerrit CR set to 2080
Actions #3

Updated by Spencer Evans-Cole 4 months ago

Attached is the c program I wrote to induce this bug and test its fix.

Uses getpid() and execv() to call pwait with the same pid as itself

Actions #4

Updated by Electric Monk 4 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit b1bc843f030b066c3da149508c52f7306b25b8ff

commit  b1bc843f030b066c3da149508c52f7306b25b8ff
Author: Spencer Evans-Cole <spencer.ec09@gmail.com>
Date:   2022-04-13T03:41:33.000Z

    14592 pwait(1) should never wait on its own PID
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Reviewed by: Matt Barden <mbarden@tintri.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF