From owner-freebsd-hackers Thu Mar 7 11:34:47 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mailout05.sul.t-online.com (mailout05.sul.t-online.com [194.25.134.82]) by hub.freebsd.org (Postfix) with ESMTP id 325DC37B41C for ; Thu, 7 Mar 2002 11:34:41 -0800 (PST) Received: from fwd00.sul.t-online.de by mailout05.sul.t-online.com with smtp id 16j3d4-0007lF-03; Thu, 07 Mar 2002 20:32:42 +0100 Received: from spirit.corecode.ath.cx (320050403952-0001@[80.128.122.16]) by fmrl00.sul.t-online.com with esmtp id 16j3cr-1nZBGSC; Thu, 7 Mar 2002 20:32:29 +0100 Received: from elevation.zuhause.stoert.net (elevation.zuhause.stoert.net [192.168.66.46]) by spirit.corecode.ath.cx (8.11.6/8.11.6) with ESMTP id g27JWZc06400; Thu, 7 Mar 2002 20:32:35 +0100 (CET) (envelope-from corecode@corecode.ath.cx) Received: (from corecode@localhost) by elevation.zuhause.stoert.net (8.11.6/8.11.6) id g27JWTS84234; Thu, 7 Mar 2002 20:32:29 +0100 (CET) (envelope-from corecode) Date: Thu, 7 Mar 2002 20:32:25 +0100 From: "Simon 'corecode' Schubert" To: Terry Lambert Cc: freebsd-hackers@FreeBSD.ORG Subject: Optimisation errors (Was: Swapping performance) Message-Id: <20020307203225.54d79d1d.corecode@corecode.ath.cx> In-Reply-To: <3C87B632.43156193@mindspring.com> References: <20020307090707.GC26621@elvis.mu.org> <20020307142759.0d95d467.mitko@rila.bg> <20020307080906.367be8df.gclarkii@vsservices.com> <20020307164724.D377@straylight.oblivion.bg> <20020307153615.GB1942@student.uu.se> <20020307164500.5dd21d16.corecode@corecode.ath.cx> <3C87B632.43156193@mindspring.com> X-Mailer: Sylpheed version 0.7.2claws (GTK+ 1.2.10; i386--freebsd4.5) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=.RKEMOP_lw+EYp7" X-Sender: 320050403952-0001@t-dialin.net Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=.RKEMOP_lw+EYp7 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 07 Mar 2002 10:49:22 -0800 Terry Lambert wrote: > Simon 'corecode' Schubert wrote: > > to everybody who doesn't believe that: it really generates bad code. > > i've been having severe problems with my tcp and udp stack lately (on a > > i586/mmx machine). guess what, -O2 resulted in code which >>sometimes<< > > generated bad tcp and/or udp checksums (depending on ip). i didn't > > investigate any further, but believe me: not being able to access some > > dns servers is a pain in the ass. > > Are you using NAT? yep. > The libalias incremental checksum calculation is incorrect; > it assumes that a two's complement network order underflow > will result in the same value as a one's complement host > order underflow. This results in off-by-one errors. so is this an optimisation issue or not? when compiling with -O it works again. furthermore i don't know if my bind uses the internal address or the external one for queries. > This is actually a *different* problem than the RFC 1624 > correction of RFC 1141 (also an off-by-one error). > > Have you used a recent version of ethereal? It's an incredible > bugger to get installed correctly for 4.5 or above, since you > have to come from packages (the dependencies for the ports are > incorrect), but it will tell you the correct checksum vs. the > one that it got. > > There's also printing it out in tcp_input when you get a bad > checksum. If you see a lot of "0xfffe", then you'll know it's > an off-by-one error. yah, got lots of them, seen in tcpdump -vvvxXlei gif0 ;] > If the problem is only on ACK packets... I can tell you that > the tcp_respond() code path is not really throughly exercised. tho i've seen these problems recently on UDP DNS lookups, too. then i switched back to -O cheerz corecode -- /"\ http://corecode.ath.cx/ \ / \ ASCII Ribbon Campaign / \ Against HTML Mail and News --=.RKEMOP_lw+EYp7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) iD8DBQE8h8BMr5S+dk6z85oRAi7RAJ4qod0k5H4LDGuPaFp5keJ9mLmH6wCfcp5X v20R+i1Gb1Ujbcx+dWuns1U= =HVVj -----END PGP SIGNATURE----- --=.RKEMOP_lw+EYp7-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message