From owner-freebsd-bugs Tue May 8 14:40: 7 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8CF1D37B42C for ; Tue, 8 May 2001 14:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f48Le1A14624; Tue, 8 May 2001 14:40:01 -0700 (PDT) (envelope-from gnats) Received: from mail.disney.com (mail.disney.com [204.128.192.15]) by hub.freebsd.org (Postfix) with ESMTP id 0E86437B42C for ; Tue, 8 May 2001 14:39:36 -0700 (PDT) (envelope-from Jim.Pirzyk@disney.com) Received: from pain10.corp.disney.com (root@pain10.corp.disney.com [153.7.110.100]) by mail.disney.com (Switch-2.0.1/Switch-2.0.1) with SMTP id f48LcxA11129 for ; Tue, 8 May 2001 14:38:59 -0700 (PDT) Received: from louie.fa.disney.com by pain.corp.disney.com with ESMTP for FreeBSD-gnats-submit@freebsd.org; Tue, 8 May 2001 14:40:16 -0700 Received: from plio.fan.fa.disney.com (plio.fan.fa.disney.com [153.7.118.2]) by louie.fa.disney.com (8.9.2/8.9.2) with ESMTP id OAA13105 for ; Tue, 8 May 2001 14:39:29 -0700 (PDT) (envelope-from Jim.Pirzyk@fa.disney.com) Received: from snoopy.fan.fa.disney.com (snoopy.fan.fa.disney.com [153.7.117.170]) by plio.fan.fa.disney.com (8.9.2/8.9.2) with ESMTP id OAA08523 for ; Tue, 8 May 2001 14:39:28 -0700 (PDT) (envelope-from Jim.Pirzyk@fa.disney.com) Received: (from Jim.Pirzyk@localhost) by snoopy.fan.fa.disney.com (8.11.3/8.9.3) id f48LdSM23731; Tue, 8 May 2001 14:39:28 -0700 (PDT) (envelope-from Jim.Pirzyk@fa.disney.com) Message-Id: <200105082139.f48LdSM23731@snoopy.fan.fa.disney.com> Date: Tue, 8 May 2001 14:39:28 -0700 (PDT) From: Jim.Pirzyk@disney.com Reply-To: Jim.Pirzyk@disney.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: kern/27215: /compat/linux/proc/stat has overflows Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 27215 >Category: kern >Synopsis: when cat'ing /compat/linux/proc/stat, we have negative numbers >Confidential: no >Severity: critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue May 08 14:40:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Jim Pirzyk >Release: FreeBSD 4.3-RELEASE i386 >Organization: >Environment: System: FreeBSD snoopy.fan.fa.disney.com 4.3-RELEASE FreeBSD 4.3-RELEASE #4: Fri Apr 27 01:14:59 PDT 2001 root@snoopy.fan.fa.disney.com:/auto/roy/dist/pub/FreeBSD/4.3-RELEASE/sys/compile/UP_WORKSTATION i386 linprocfs kernel module. >Description: cat'ing /compat/linux/proc/stat, we get negative cpu times: cpu 398258 232 158121 -7243116 Our cp_time values are: kern.cp_time: 509774 298 202401 25981 248432116 >How-To-Repeat: cat /compat/linux/proc/stat >Fix: *** linprocfs_misc.c.orig Thu Dec 7 05:17:55 2000 --- linprocfs_misc.c Tue May 8 14:23:25 2001 *************** *** 71,77 **** /* * Various conversion macros */ ! #define T2J(x) (((x) * 100) / (stathz ? stathz : hz)) /* ticks to jiffies */ #define T2S(x) ((x) / (stathz ? stathz : hz)) /* ticks to seconds */ #define B2K(x) ((x) >> 10) /* bytes to kbytes */ #define P2B(x) ((x) << PAGE_SHIFT) /* pages to bytes */ --- 71,77 ---- /* * Various conversion macros */ ! #define T2J(x) (((x) * 100UL) / (stathz ? stathz : hz)) /* ticks to jiffies */ #define T2S(x) ((x) / (stathz ? stathz : hz)) /* ticks to seconds */ #define B2K(x) ((x) >> 10) /* bytes to kbytes */ #define P2B(x) ((x) << PAGE_SHIFT) /* pages to bytes */ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message