Project

General

Profile

Bug #11606

process erroneously shows up as from 1970

Added by Jason King 11 months ago. Updated 10 months ago.

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

100%

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

Description

Upstream of Joyent OS-2825:

I've twice now caught a process in a state where it shows having been created in 1970. It changes quickly to a normal time, I haven't reproduced it since, and I have no other information.

Transcribing this:

[root@headnode (shrimp) ~]# svcs -p marlin-agent
STATE          STIME    FMRI
online         23:06:15 svc:/smartdc/agent/marlin-agent:default
               1970         2231     
               23:06:15    45754 node
               23:06:17    45764 node

History

#1

Updated by Electric Monk 10 months ago

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

git commit 81ff72c5f2cea16235aa4a42d83d07e20090498d

commit  81ff72c5f2cea16235aa4a42d83d07e20090498d
Author: Jason King <jason.king@joyent.com>
Date:   2019-09-11T04:42:21.000Z

    11606 process erroneously shows up as from 1970
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Peter Tribble <peter.tribble@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

#2

Updated by Jason King 10 months ago

To test, I used a similar program as with the original change setup as an SMF service

#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <err.h>

int
main(void)
{
    daemon(0, 0);

    for (;;) {
        pid_t pid = fork();
        int status;

        switch (pid) {
        case (pid_t)-1:
            err(EXIT_FAILURE, "fork");
        case 0:
            wait(&status);
            break;
        default:
            sleep(1);
            return (0);
        }
      }

     return (0);
}

I then enabled the service (system/test) and ran svcs -p system/test repeatedly observing the output. Without the change, one would see times of 1970 (as described in the original issue). Run in a BE with the fix applied, the entries would now show up as <defunct>. E.g.:

root@pi:/ws/illumos-gate (svcs)# svcs -p test |egrep 'def|1970'
online         21:10:28 svc:/system/test:default
               -          513415 <defunct>
               -          513416 <defunct>

And no dates of 1970 were observed (as expected).

Also available in: Atom PDF