From owner-freebsd-current@FreeBSD.ORG Sat Jul 23 06:44:52 2005 Return-Path: X-Original-To: freebsd-current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5CEFF16A41F; Sat, 23 Jul 2005 06:44:52 +0000 (GMT) (envelope-from grog@lemis.com) Received: from blackwater.lemis.com (wantadilla.lemis.com [192.109.197.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38C3743D45; Sat, 23 Jul 2005 06:44:51 +0000 (GMT) (envelope-from grog@lemis.com) Received: by blackwater.lemis.com (Postfix, from userid 1004) id 94ACC86DDA; Sat, 23 Jul 2005 16:14:49 +0930 (CST) Date: Sat, 23 Jul 2005 16:14:49 +0930 From: Greg 'groggy' Lehey To: Doug Barton Message-ID: <20050723064449.GZ842@wantadilla.lemis.com> References: <200507230146.j6N1koqL061690@repoman.freebsd.org> <20050723015517.GA28428@nagual.pp.ru> <20050723020120.GV842@wantadilla.lemis.com> <42E1DFCE.6090506@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XilfshMFnlxBucLf" Content-Disposition: inline In-Reply-To: <42E1DFCE.6090506@FreeBSD.org> User-Agent: Mutt/1.4.2.1i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Cc: freebsd-current@FreeBSD.org Subject: Re: cvs commit: src/games/fortune/fortune fortune.c X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2005 06:44:52 -0000 --XilfshMFnlxBucLf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Friday, 22 July 2005 at 23:12:30 -0700, Doug Barton wrote: > Changing venue to -current, since these kinds of protracted discussions > don't belong on the commit mailing lists. > > Greg 'groggy' Lehey wrote: > >> But for whatever reasons, many systems seem to have incorrect >> random(4) initialization. > > I don't think it has anything to do with /dev/random initialization, I > think that there is an error somewhere in the fortune code that is causing > this problem. You should take a look at what I committed. It simply uses the microsecond value returned by getlocaltime() for the automatic seeding by srandomdev(). It fixes the problem. I can see only two explanations: 1. srandomdev(), random(4) or friends are broken. 2. random(4) has been initialized incorrectly. Currently I'm guessing (2), but I don't care much either way. > I have seen the same problem Greg has for a long time now, > but for me it's the fortune with the CVS $FreeBSD$ tag that comes up about > 8 times out of 10. This is still true even on a system that has been up a= nd > running for hours, and has kern.random.sys.seeded: 1 > > I can't tell if it's a problem with how the files are randomized in the > first place, or how they get played back, but I haven't looked at this ve= ry > hard yet. The obvious thing is to try this patch and see what happens. >> You'll recall the debate about removing Rush Limbaugh fortunes recently > > I didn't see this debate as I've had e-mail "issues" for the last couple = of > days, what list was it on?=20 This was early 2004, it seems. I've told you the details on IRC (and I've dropped the buffer from Emacs, so I've forgotten the details; sorry to the rest of you, but ISTR it was a message from Stephen Mckay to -chat on 4 January 2004). > In any case, I would not be at all happy if these fortunes were > removed. I agreed to add them to the "offensive" fortune database > because the rule there is that you don't add -o or -a to your > command line unless you are willing to run the risk of being > offended. If every committer gets to go through the fortune > database and remove every fortune that they find offensive, it's > going to be a mighty small file. There was no discussion of that. If you go back to the thread I mentioned, you'll see that, though I don't like them, I found it inappropriate to remove them. >> This is the only place where it seems to make any difference, so >> it's easier to use a different seed. > > Since my thesis is that this is not a /dev/random initialization > problem, I tend to agree with you. Just to be on the safe side, I > have bumped up both the size and number of my /var/db/entropy files, > and I'll gladly be proven wrong on this one. However, I sincerely > doubt that this is actually a problem with /dev/random. It's certainly worth following up on. From the PoV of fortune, it's really not worth worrying about the most perfect random number generator; I suspect that the microsecond seed will satisfy everybody except possibly the purists. That doesn't mean that we should forget the potential issues with random(4). Greg -- The virus once contained in this message has lost interest in life, shrivelled up and died. LEMIS anti-virus has given it an appropriate burial. For further details see http://www.lemis.com/grog/lemis-virus.html Finger grog@FreeBSD.org for PGP public key. See complete headers for address and phone numbers. --XilfshMFnlxBucLf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFC4edhIubykFB6QiMRAiNZAJ90Ax8+5/E9JIHp/Gz+6nYorsC5rgCdHlm6 9hh+LYGgoKypKGgjeiLlLpw= =0gXs -----END PGP SIGNATURE----- --XilfshMFnlxBucLf--