From owner-freebsd-audit  Sun Dec 31  3:30:27 2000
From owner-freebsd-audit@FreeBSD.ORG  Sun Dec 31 03:30:24 2000
Return-Path: <owner-freebsd-audit@FreeBSD.ORG>
Delivered-To: freebsd-audit@freebsd.org
Received: from mailout06.sul.t-online.com (mailout06.sul.t-online.com [194.25.134.19])
	by hub.freebsd.org (Postfix) with ESMTP id 30A2A37B400
	for <audit@freebsd.org>; Sun, 31 Dec 2000 03:30:24 -0800 (PST)
Received: from fwd02.sul.t-online.com 
	by mailout06.sul.t-online.com with smtp 
	id 14Cggw-0001AE-02; Sun, 31 Dec 2000 12:30:22 +0100
Received: from neutron.cichlids.com (520050424122-0001@[62.157.56.132]) by fmrl02.sul.t-online.com
	with esmtp id 14Cggm-0990qWC; Sun, 31 Dec 2000 12:30:12 +0100
Received: from cichlids.cichlids.com (cichlids.cichlids.com [192.168.0.10])
	by neutron.cichlids.com (Postfix) with ESMTP id 29911AB0C
	for <audit@freebsd.org>; Sun, 31 Dec 2000 12:30:40 +0100 (CET)
Received: by cichlids.cichlids.com (Postfix, from userid 1001)
	id A579714A70; Sun, 31 Dec 2000 12:30:12 +0100 (CET)
Date: Sun, 31 Dec 2000 12:30:12 +0100
To: audit@freebsd.org
Subject: _BSD_TIME_T in i386 to int
Message-ID: <20001231123012.A7652@cichlids.cichlids.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
X-PGP-Fingerprint: 44 28 CA 4C 46 5B D3 A8  A8 E3 BA F3 4E 60 7D 7F
X-PGP-at: finger alex@big.endian.de
X-Verwirrung: Dieser Header dient der allgemeinen Verwirrung.
From: alex@big.endian.de (Alexander Langer)
X-Sender: 520050424122-0001@t-dialin.net
Sender: owner-freebsd-audit@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.ORG

Hello folks!

We have been discussing the type of _BSD_TIME_T_ some months ago.
BDE mentioned, that in his tree he has changed the type of
_BSD_TIME_T_ to match the alpha version, i.e. "int" and not long.

What about this patch in this case?
I have a working kernel running with this patch, though I didn't test
"make world".
However, since sizeof(int) == sizeof(long) on IA32, this really
shouldn't make a problem.  _But_, it detects applications who think
_BSD_TIME_T_ is long in error.

Opinions?

cvs diff: Diffing .
Index: ansi.h
===================================================================
RCS file: /usr/home/ncvs/src/sys/i386/include/ansi.h,v
retrieving revision 1.19
diff -u -r1.19 ansi.h
--- ansi.h	2000/10/27 11:45:26	1.19
+++ ansi.h	2000/12/30 19:53:10
@@ -52,7 +52,7 @@
 #define	_BSD_RUNE_T_	_BSD_CT_RUNE_T_		/* rune_t (see below) */
 #define	_BSD_SIZE_T_	unsigned int		/* sizeof() */
 #define	_BSD_SSIZE_T_	int			/* byte count or error */
-#define	_BSD_TIME_T_	long			/* time()... */
+#define	_BSD_TIME_T_	int			/* time()... */
 #define	_BSD_TIMER_T_	int			/* timer_gettime()... */
 #define	_BSD_WCHAR_T_	_BSD_CT_RUNE_T_		/* wchar_t (see below) */
 
-- 
cat: /home/alex/.sig: No such file or directory


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message


From owner-freebsd-audit  Sun Dec 31  8:26:33 2000
From owner-freebsd-audit@FreeBSD.ORG  Sun Dec 31 08:26:31 2000
Return-Path: <owner-freebsd-audit@FreeBSD.ORG>
Delivered-To: freebsd-audit@freebsd.org
Received: from mailout02.sul.t-online.com (mailout02.sul.t-online.com [194.25.134.17])
	by hub.freebsd.org (Postfix) with ESMTP id 9B57237B400
	for <audit@freebsd.org>; Sun, 31 Dec 2000 08:26:30 -0800 (PST)
Received: from fwd06.sul.t-online.com 
	by mailout02.sul.t-online.com with smtp 
	id 14ClJV-0006Ww-01; Sun, 31 Dec 2000 17:26:29 +0100
Received: from neutron.cichlids.com (520050424122-0001@[62.157.56.132]) by fmrl06.sul.t-online.com
	with esmtp id 14ClJL-1zgQsaC; Sun, 31 Dec 2000 17:26:19 +0100
Received: from cichlids.cichlids.com (cichlids.cichlids.com [192.168.0.10])
	by neutron.cichlids.com (Postfix) with ESMTP id AD639AB0C
	for <audit@freebsd.org>; Sun, 31 Dec 2000 17:26:43 +0100 (CET)
Received: by cichlids.cichlids.com (Postfix, from userid 1001)
	id 9F16614AF8; Sun, 31 Dec 2000 17:26:07 +0100 (CET)
Date: Sun, 31 Dec 2000 17:26:07 +0100
To: audit@freebsd.org
Subject: getnanouptime() patch
Message-ID: <20001231172607.A175@cichlids.cichlids.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
X-PGP-Fingerprint: 44 28 CA 4C 46 5B D3 A8  A8 E3 BA F3 4E 60 7D 7F
X-PGP-at: finger alex@big.endian.de
X-Verwirrung: Dieser Header dient der allgemeinen Verwirrung.
From: alex@big.endian.de (Alexander Langer)
X-Sender: 520050424122-0001@t-dialin.net
Sender: owner-freebsd-audit@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.ORG

Hello!

I have this old mail from BDE sitting here about the print_uptime()
bugs.  One of these bugs is:

- the implementation is buggy.  getnanouptime() accesses uninitialized
  pointers when it is called before timecounters have been
initialized.
  This causes recursive panics which lock up at least my systems (boot
  with -d and decide you didn't want to boot this kernel after all,
  and type "panic" at the debugger prompt -- this locks up the system).

The following patch to getnanouptime() should fix this.

I don't know what the KTR define is for, I stole this from another
function in the kern_tc.c file, which also handles uninitialized
pointer correctly.

Comments?


cvs diff: Diffing .
Index: kern_tc.c
===================================================================
RCS file: /usr/home/ncvs/src/sys/kern/kern_tc.c,v
retrieving revision 1.109
diff -u -r1.109 kern_tc.c
--- kern_tc.c	2000/09/07 01:32:51	1.109
+++ kern_tc.c	2000/12/31 16:23:27
@@ -188,6 +188,13 @@
 
 	ngetnanouptime++;
 	tc = timecounter;
+#ifdef KTR
+	if (tc == NULL) {		/* called before initialization */
+		tsp->tv_sec = 0;
+		tsp->tv_nsec = 0;
+		return;
+	}
+#endif
 	tsp->tv_sec = tc->tc_offset_sec;
 	tsp->tv_nsec = tc->tc_offset_nano >> 32;
 }

-- 
cat: /home/alex/.sig: No such file or directory


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message


From owner-freebsd-audit  Sun Dec 31 12: 6:17 2000
From owner-freebsd-audit@FreeBSD.ORG  Sun Dec 31 12:06:16 2000
Return-Path: <owner-freebsd-audit@FreeBSD.ORG>
Delivered-To: freebsd-audit@freebsd.org
Received: from rover.village.org (rover.village.org [204.144.255.66])
	by hub.freebsd.org (Postfix) with ESMTP id 38C7637B400
	for <audit@FreeBSD.ORG>; Sun, 31 Dec 2000 12:06:15 -0800 (PST)
Received: from harmony.village.org (harmony.village.org [10.0.0.6])
	by rover.village.org (8.11.0/8.11.0) with ESMTP id eBVK6Ds84680;
	Sun, 31 Dec 2000 13:06:14 -0700 (MST)
	(envelope-from imp@harmony.village.org)
Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id NAA12743; Sun, 31 Dec 2000 13:06:13 -0700 (MST)
Message-Id: <200012312006.NAA12743@harmony.village.org>
To: alex@big.endian.de (Alexander Langer)
Subject: Re: getnanouptime() patch 
Cc: audit@FreeBSD.ORG
In-reply-to: Your message of "Sun, 31 Dec 2000 17:26:07 +0100."
		<20001231172607.A175@cichlids.cichlids.com> 
References: <20001231172607.A175@cichlids.cichlids.com>  
Date: Sun, 31 Dec 2000 13:06:12 -0700
From: Warner Losh <imp@bsdimp.com>
Sender: imp@harmony.village.org
Sender: owner-freebsd-audit@FreeBSD.ORG
Precedence: bulk
X-Loop: FreeBSD.ORG

In message <20001231172607.A175@cichlids.cichlids.com> Alexander Langer writes:
: I don't know what the KTR define is for, I stole this from another
: function in the kern_tc.c file, which also handles uninitialized
: pointer correctly.
: 
: Comments?

I don't know about the ifdef, but this patch seems as sane as you can
make it in the vacuum of information.

Warner


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message


