From jari@apeli.tky.hut.fi  Wed Apr  9 08:14:37 1997
Received: from apeli.tky.hut.fi (apeli.tky.hut.fi [130.233.17.200])
          by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id IAA24895
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 9 Apr 1997 08:14:35 -0700 (PDT)
Received: (from jari@localhost)
	by apeli.tky.hut.fi (8.8.5/8.8.5) id RAA12395;
	Wed, 9 Apr 1997 17:49:20 +0300 (EEST)
Message-Id: <199704091449.RAA12395@apeli.tky.hut.fi>
Date: Wed, 9 Apr 1997 17:49:20 +0300 (EEST)
From: jari@apeli.tky.hut.fi
To: FreeBSD-gnats-submit@freebsd.org
Subject: bug with times(3) in 2.2-RELEASE
X-Send-Pr-Version: 3.2

>Number:         3241
>Category:       bin
>Synopsis:       times(3) returns only stime
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr  9 08:20:00 PDT 1997
>Closed-Date:    Sun Apr 5 23:44:19 PDT 1998
>Last-Modified:  Sun Apr  5 23:45:07 PDT 1998
>Originator:     Jari Kokko
>Release:        FreeBSD 2.2-RELEASE i386
>Organization:
La Societe du Billard d'Otaniemi (SBO)
>Environment:

FreeBSD apeli.tky.hut.fi 2.2-RELEASE FreeBSD 2.2-RELEASE #0: Sun Mar 30 19:40:43 EEST 1997     oku@apeli.tky.hut.fi:/usr/src/sys/compile/APELI  i386

>Description:

	the times(3) library function only returns tms_stime in
	struct tms.

>How-To-Repeat:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <sys/times.h>

main()
{
    unsigned long int i=0;
    struct tms t;
    FILE *f;

    f=fopen("foo", "w");
    if (!f)
        perror("dghj");
    fclose(f);

    for (i=0; i < 100000; i++)
        sin(60);
        
    if ((i=times(&t)) < 0)
        perror("foo");    

    printf("utime %d, stime %d, cutime %d, cstime %d\n", 
           t.tms_utime,
           t.tms_stime,
           t.tms_cutime,
           t.tms_cstime);
    
    return 0;
}

$ uname -r; cc -o bar timestst.c -lm; ./bar
2.2-RELEASE
utime 0, stime 331, cutime 0, cstime 0

compare that with:

$ uname -r ; cc -o bar timestst.c -lm ; ./bar
2.1.5-RELEASE
utime 40, stime 2, cutime 0, cstime 0

>Fix:
	
No idea, I'm afraid
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: mpp 
State-Changed-When: Wed Apr 9 12:28:43 PDT 1997 
State-Changed-Why:  
The test program works correctly under 2.1.7 and 3.0-current. 
I don't have a 2.2 system to test this on, so I can't verify 
that it fails to work under 2.2 as reported in the PR. 

From: Peter Wemm <peter@spinner.DIALix.COM>
To: Mike Pritchard <mpp@freefall.freebsd.org>
Cc: jari@apeli.tky.hut.fi, freebsd-bugs@freefall.freebsd.org,
        freebsd-gnats-submit@freebsd.org
Subject: Re: bin/3241 
Date: Thu, 10 Apr 1997 04:19:50 +0800

 Mike Pritchard wrote:
 > Synopsis: times(3) returns only stime
 > 
 > The test program works correctly under 2.1.7 and 3.0-current.
 > I don't have a 2.2 system to test this on, so I can't verify
 > that it fails to work under 2.2 as reported in the PR.
 
 Most likely this was because the statclock got stalled.  This has been 
 recently fixed in -current.  A good way to test for this is to run "systat 
 -vmstat 1" and see if it says that "the alternate system clock has died".  
 If so, you should schedule a reboot since the process scheduler is 
 adversely affected.  Alternatively, if you have DDB loaded in the kernel, 
 you might try entering ddb, running the "show rtc" command, and exiting 
 with "c" (continue).  That might be enough to restart it.
 
 Cheers,
 -Peter
 
 
State-Changed-From-To: analyzed->closed 
State-Changed-By: phk 
State-Changed-When: Sun Apr 5 23:44:19 PDT 1998 
State-Changed-Why:  
timed out. 
>Unformatted:
