From owner-freebsd-bugs Fri Mar 5 8:50:18 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 06C2B151B2 for ; Fri, 5 Mar 1999 08:50:15 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id IAA60014; Fri, 5 Mar 1999 08:50:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from lion.plab.ku.dk (lion.plab.ku.dk [130.225.105.49]) by hub.freebsd.org (Postfix) with ESMTP id AAE1C151CA for ; Fri, 5 Mar 1999 08:49:03 -0800 (PST) (envelope-from tobez@lion.plab.ku.dk) Received: (from tobez@localhost) by lion.plab.ku.dk (8.9.3/8.9.1) id RAA23394; Fri, 5 Mar 1999 17:48:28 +0100 (CET) Message-Id: <199903051648.RAA23394@lion.plab.ku.dk> Date: Fri, 5 Mar 1999 17:48:28 +0100 (CET) From: tobez@plab.ku.dk Reply-To: tobez@plab.ku.dk To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/10402: times(3) non-decreaseness broken in 4.0 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 10402 >Category: kern >Synopsis: times(3) non-decreaseness broken in 4.0 >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Mar 5 08:50:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Anton Berezin >Release: FreeBSD 4.0-CURRENT i386 >Organization: The Protein Laboratory, University of Copenhagen >Environment: FreeBSD lion.plab.ku.dk 4.0-CURRENT FreeBSD 4.0-CURRENT #12: Fri Mar 5 13:02:17 CET 1999 root@lion.plab.ku.dk:/usr/src/sys/compile/LION i386 Different Perls: perl5.005_02 - standard perl perl5.005_03-MAINT_TRIAL_6 perl5.005_56 >Description: (I think the correct category is kern; I might be wrong) When testing recent versions of Perl on also-recent 4.0-current, a strange test failure consistently occurs. I dug this a little bit, and it turned out that sometimes the second (or n-th) call to times(3) can return a value of tms_stime less than that of the first call. Perl's times() directly translates into a call to times(3) plus divisions to get values in seconds. Running a test script below (in How-To-Repeat section) sufficient number of times, I've got (among the other values) 0 0.0078125 0 0 (i = 100000, beg = 920651342, time = 920651344) ---------------- and 0 0.0078125 0.0078125 0 (i = 100000, beg = 920651344, time = 920651347) ---------------- which clearly shows that system time can actually decrease. >How-To-Repeat: Create a perl script ----------------------8<---------------------8<--------------- #! /usr/bin/perl ($beguser,$begsys) = times; $beg = time; for ($i = 0; $i < 100000; $i++) { ($nowuser, $nowsys) = times; $i = 200000 if $nowuser > $beguser && ( $nowsys > $begsys || (!$nowsys && !$begsys)); last if time - $beg > 20; } my $ttt = time; if ($i < 200000) { print "$beguser $begsys\n"; print "$nowuser $nowsys (i = $i, beg = $beg, time = $ttt)\n"; print "----------------\n"; } ----------------------8<---------------------8<--------------- and run it several times, better in a shell loop. >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message