From nobody@FreeBSD.org  Tue Mar 13 19:16:57 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 09C5337B719
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 Mar 2001 19:16:57 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f2E3Gvi59920;
	Tue, 13 Mar 2001 19:16:57 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200103140316.f2E3Gvi59920@freefall.freebsd.org>
Date: Tue, 13 Mar 2001 19:16:57 -0800 (PST)
From: piechota@argolis.org
To: freebsd-gnats-submit@FreeBSD.org
Subject: microuptime() weny backwards, again
X-Send-Pr-Version: www-1.0

>Number:         25788
>Category:       kern
>Synopsis:       microuptime() weny backwards, again
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 13 19:20:00 PST 2001
>Closed-Date:    Tue May 29 02:33:30 PDT 2001
>Last-Modified:  Wed Dec 12 17:00:01 PST 2001
>Originator:     Matt Piechota
>Release:        FreeBSD 4.2-STABLE
>Organization:
>Environment:
FreeBSD cithaeron.argolis.org 4.2-STABLE FreeBSD 4.2-STABLE #1: Wed Feb 28 11:30:32 EST 2001 i386
>Description:
I get microuptime() went backwards messages on the console every once in awhile.  I can't exactly determine how to set them off, but just normal machine use does it.  I wouldn't much care it it wouldn't crash my named about half the time.  This has only started to happen since I moved to 4.X.  This machine ran 3.3-3.5 for almost a year with no problems.  IT was cvssupped around Feb 28 from the 4.X-STABLE tree.

Epox motherboard, with an AMD K6-2 350 on it.  Other PRs mentioned UDMA causing trouble, but this system runs off an Adaptec 2940UW (except the CDROM, but that hasn't been used since the install).  The BIOS power management is turned off, and I don't have APM in the kernel.

sysctl kern.timecounter returns:
kern.timecounter.method: 0
kern.timecounter.hardware: i8254

dmesg is currently:
Copyright (c) 1992-2001 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD 4.2-STABLE #1: Wed Feb 28 11:30:32 EST 2001
    root@cithaeron.argolis.org:/usr/obj/usr/src/sys/CITHAERON
Timecounter "i8254"  frequency 1193182 Hz
CPU: AMD-K6(tm) 3D processor (350.80-MHz 586-class CPU)
  Origin = "AuthenticAMD"  Id = 0x58c  Stepping = 12
  Features=0x8021bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,PGE,MMX>
  AMD Features=0x80000800<SYSCALL,3DNow!>
real memory  = 67108864 (65536K bytes)
config> q
avail memory = 61890560 (60440K bytes)
Preloaded elf kernel "kernel" at 0xc0368000.
Preloaded userconfig_script "/boot/kernel.conf" at 0xc036809c.
K6-family MTRR support enabled (2 registers)
md0: Malloc disk
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <Host to PCI bridge> on motherboard
pci0: <PCI bus> on pcib0
pcib2: <VIA 82C598MVP (Apollo MVP3) PCI-PCI (AGP) bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib2
isab0: <VIA 82C596B PCI-ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <VIA 82C596 ATA33 controller> port 0xd000-0xd00f at device 7.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
uhci0: <VIA 83C572 USB controller> port 0xd400-0xd41f irq 11 at device 7.2 on pc
i0
usb0: <VIA 83C572 USB controller> on uhci0
usb0: USB revision 1.0
uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
ahc0: <Adaptec 2940 Ultra SCSI adapter> port 0xd800-0xd8ff mem 0xe7102000-0xe710
2fff irq 10 at device 8.0 on pci0
aic7880: Wide Channel A, SCSI Id=7, 16/255 SCBs
fxp0: <Intel Pro 10/100B/100+ Ethernet> port 0xdc00-0xdc1f mem 0xe7000000-0xe70f
ffff,0xe7100000-0xe7100fff irq 12 at device 9.0 on pci0
fxp0: Ethernet address 00:a0:c9:05:ff:fd
de0: <Digital 21041 Ethernet> port 0xe000-0xe07f mem 0xe7101000-0xe710107f irq 5
 at device 10.0 on pci0
de0: 21041 [10Mb/s] pass 2.1
de0: address 00:40:05:36:57:f1
pcib1: <Host to PCI bridge> on motherboard
pci2: <PCI bus> on pcib1
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
kbd0 at atkbd0
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/16 bytes threshold
ppi0: <Parallel I/O> on ppbus0
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
de0: enabling 10baseT port
IP packet filtering initialized, divert enabled, rule-based forwarding enabled,
default to deny, logging disabled
acd0: CDROM <TOSHIBA CD-ROM XM-5602B> at ata1-slave using PIO3
Waiting 15 seconds for SCSI devices to settle
Mounting root from ufs:/dev/da0s1a
da1 at ahc0 bus 0 target 4 lun 0
da1: <QUANTUM FIREBALL ST6.4S 0F0C> Fixed Direct Access SCSI-2 device
da1: 20.000MB/s transfers (20.000MHz, offset 15), Tagged Queueing Enabled
da1: 6180MB (12657717 512 byte sectors: 255H 63S/T 787C)
da0 at ahc0 bus 0 target 1 lun 0
da0: <SEAGATE ST34555W 0930> Fixed Direct Access SCSI-2 device
da0: 40.000MB/s transfers (20.000MHz, offset 8, 16bit), Tagged Queueing Enabled
da0: 4340MB (8888924 512 byte sectors: 255H 63S/T 553C)
microuptime() went backwards (92961.922154 -> 92961.-694746181)
microuptime() went backwards (99894.857770 -> 99894.850112)
microuptime() went backwards (100534.398866 -> 100534.-695217375)
microuptime() went backwards (128117.346728 -> 128117.-695315098)
microuptime() went backwards (130449.738615 -> 130449.-694932866)
microuptime() went backwards (133120.999845 -> 133120.-694639703)
pid 250 (named), uid 0: exited on signal 6 (core dumped)
microuptime() went backwards (474987.078609 -> 474987.-695597242)
microuptime() went backwards (629762.606331 -> 629762.598829)
microuptime() went backwards (630099.144628 -> 630099.136070)
pid 19428 (named), uid 0: exited on signal 6 (core dumped)


I've read though the other PRs on this issue, none of the solutions seem to work.  Am I SOL?
>How-To-Repeat:
It seems to happen through normal system use, although the it took a break for 4 days this time, after happening about 3 times a day the 2 previous days, twice yesterday, but not at all today. (it's 10pm right now).  I haven't been using the system oddly on the days it happened (or didn't happen).
>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Tue May 29 02:33:30 PDT 2001 
State-Changed-Why:  
known issue. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=25788 

From: Goran Dokic <goran@euro.net>
To: freebsd-gnats-submit@FreeBSD.org, ming@unixbox.com
Cc:  
Subject: Re: kern/25788: microuptime() weny backwards, again
Date: Thu, 13 Dec 2001 01:49:25 +0100

 Hi,
 
 I just suffered the 'microuptime() went backwards' bug in 
 
 FreeBSD fire.8hz.com 4.4-RELEASE FreeBSD 4.4-RELEASE #1: i386
 And XFree 4.1.
 
 I was diffing a CD I just burned (cd was in my 32* UltraPlex CD-ROM on an 
 Adaptec 2940 controller) with the original file when the machine locked up:
 
 Dec 13 00:35:51 fire /kernel: cd9660: RockRidge Extension
 Dec 13 00:37:46 fire /kernel: microuptime() went backwards (520036.285909 -> 520
 036.-695120903)
 
 That was the last log entry and almost exactly at that moment I lost the
 machine. The only thing doing anything was the audio card, it kept playing the
 last byte it received.
 
 It was running diff quite actively at the moment it chocked. 
 
 It might not have anything to do with each other. But as it came pretty much at
 the same time as the crash and I never before saw a message stating anything
 about the microuptime(), I figure it might be related.
 
 For the interested:
 
 Dec 13 00:41:49 fire /kernel: goran@fire.8hz.com:/usr/src/sys/compile/FIRE
 Dec 13 00:41:49 fire /kernel: Timecounter "i8254"  frequency 1193182 Hz
 Dec 13 00:41:49 fire /kernel: CPU: Pentium III/Pentium III Xeon/Celeron (930.24-
 MHz 686-class CPU)
 Dec 13 00:41:49 fire /kernel: Origin = "GenuineIntel"  Id = 0x686  Stepping = 6
 Dec 13 00:41:49 fire /kernel: Features=0x383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,
 CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
 Dec 13 00:41:49 fire /kernel: real memory  = 133955584 (130816K bytes)
 Dec 13 00:41:49 fire /kernel: avail memory = 126476288 (123512K bytes)
 
 I have an Intel OEM board (gateway 2k) which are not the fastest, but 
 experience shows they tend to be quite stable under varied conditions...
 
 I just swapped a crocky ABIT BE6-II board in the hope of parting from the 
 numerous lockups (those boards do suck, btw). But, not a week after the 
 swap I get this. (The messages file saved from the other board didn't speak 
 of 'microuptime() went backwards', the hardware just sucked). 
 
 Well, I hope someone finds the cure soon...
 
 I'm cvsupping to 4.4STABLE now, to see if it'll happen again. If it does,
 i'll try setting the kern.timecounter.method to 1, as has been suggested 
 to ming@unixbox.com.
 
 These are my current settings:
 
 fire% sysctl kern.timecounter
 kern.timecounter.method: 0
 kern.timecounter.hardware: i8254
 
 
 
 	goran

From: Ming Zhang <ming@unixbox.com>
To: Goran Dokic <goran@euro.net>
Cc: <freebsd-gnats-submit@FreeBSD.org>
Subject: Re: kern/25788: microuptime() weny backwards, again
Date: Wed, 12 Dec 2001 16:59:01 -0800 (PST)

 On Thu, 13 Dec 2001, Goran Dokic wrote:
 >
 > fire% sysctl kern.timecounter
 > kern.timecounter.method: 0
 > kern.timecounter.hardware: i8254
 >
 >
 >
 > 	goran
 >
 
 I set it to the following and it stopped :
 
 %sysctl kern.timecounter
 kern.timecounter.method: 1
 kern.timecounter.hardware: TSC
 
 
>Unformatted:
