From owner-freebsd-current@FreeBSD.ORG Thu Feb 5 19:00:52 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22F1616F; Thu, 5 Feb 2015 19:00:52 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [IPv6:2001:470:67:39d::78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 056D59BF; Thu, 5 Feb 2015 19:00:52 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 4AE9047D; Thu, 5 Feb 2015 11:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1423162851; bh=0s417lVfzt9tPugZNQlBK7yV5r3tSUk7qHeG0ZDm/Ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nbXE0lzSNlkmlOgWxyGWT7fLH/HADl63wnLmqilSAeg0xby0vwXoSq9HDVZTUBFXm 5zzDcEBVR9WDm3zWfVOzElF4bGMSG4VeHQ2RJFuOyTf5cI4k2go/mRlCbRaloI5KZi xH4+2CTO5ARzwul0IbekrSh9pDmWc4OK0+X5eGw8= From: Peter Wemm To: John Baldwin Subject: Re: PSA: If you run -current, beware! Date: Thu, 05 Feb 2015 11:00:46 -0800 Message-ID: <14095201.eEMelRF1IS@overcee.wemm.org> User-Agent: KMail/4.14.2 (FreeBSD/11.0-CURRENT; KDE/4.14.2; amd64; ; ) In-Reply-To: <8273349.HE1luBF2tk@ralph.baldwin.cx> References: <8089702.oYScRm8BTN@overcee.wemm.org> <20150205152223.GA59664@onelab2.iet.unipi.it> <8273349.HE1luBF2tk@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart8577750.dkiWEzYNTH"; micalg="pgp-sha256"; protocol="application/pgp-signature" Cc: Konstantin Belousov , freebsd-current@freebsd.org, Luigi Rizzo X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 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: Thu, 05 Feb 2015 19:00:52 -0000 --nextPart8577750.dkiWEzYNTH Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Thursday, February 05, 2015 10:48:54 AM John Baldwin wrote: > On Thursday, February 05, 2015 04:22:23 PM Luigi Rizzo wrote: > > On Thu, Feb 05, 2015 at 08:21:45AM -0500, John Baldwin wrote: > > > On Thursday, February 05, 2015 08:48:33 AM Luigi Rizzo wrote: > > ... > >=20 > > > > > > It is fixed (in the proper meaning of the word, not like wo= rked > > > > > > around, > > > > > > covered by paper) by the patch at the end of the mail. > > > > > >=20 > > > > > > We already have a story trying to enable much less ambitiou= s > > > > > > option > > > > > > -fno-strict-overflow, see r259045 and the revert in r259422= . I do > > > > > > not > > > > > > see other way than try one more time. Too many places in k= ernel > > > > > > depend on the correctly wrapping 2-complement arithmetic, a= mong > > > > > > others > > > > > > are callweel and scheduler. > > > >=20 > > > > Rather than depending on a compiler option, wouldn't it be bett= er/more > > > > robust to change ticks to unsigned, which has specified wrappin= g > > > > behavior? > > >=20 > > > Yes, but non-trivial. It's also not limited to ticks. Since the= > > > compiler > > > knows when it would apply these optimizations, it would be nice i= f it > > > could > > > warn instead (GCC apparently has a warning, but clang does not). = Having > > > people do a manual audit of every signed integer expression in th= e tree > > > will take a long time. > >=20 > > I think I misunderstood the problem as being limited to ticks, > > which is probably only one symptom of a fundamental change in behav= iour > > of the compiler. > > Still, it might be worthwhile start looking at ints that ought to b= e > > implemented as u_int >=20 > I actually agree, I just think we are stuck with -fwrapv in the inter= val, > but it's probably not a short interval. I think converting ticks to > unsigned would be a good first start. For the record, I agree. However, I suspect that attempts to do so wil= l have=20 a non trivial number of bugs introduced. We have a track record of rec= urring=20 problems with tcp sequence number space arithmetic and tcp timing, part= ly=20 because the wraparounds happens infrequently. In the mean time, I feel that telling the compiler that it's OK to let = it=20 behave the way we expect (vs actively sabotaging it) is a viable stopga= p. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart8577750.dkiWEzYNTH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJU073eAAoJEDXWlwnsgJ4EJbUIAJHyUd7B5SIb1Kh40OBbxnqx +qH8tvo+KFNie5R7IaLL+JmcOuliyycFO32Fen5vXhW/Eiu0iXFQseRFDPme5/yd BSEfd/NrkLCgjlKJmuzmGR+P4l+8V0Xj8Aa1l/I/73Veuev8qGPHsO5gyhDHKTcY y9MEvTVGj/I4FGRlUVdO8Cr9veKASQuTtzu2i53ZVqUPMTtn1M6GgYHdF2i+xvn6 uKUsOByoXf+YaeLYfcPv5W8AZJ0AHXF6OMYnte7fqJkQXG/jUMNxgidYTw8oMns0 GEnwn/AimtoE7bFgiQr+gpesEWtoBqbfmn+OSf2A9tE/1PpiczSmcZg3pLXsK4k= =69Dg -----END PGP SIGNATURE----- --nextPart8577750.dkiWEzYNTH--