From owner-freebsd-current Wed Apr 21 0:55:43 1999 Delivered-To: freebsd-current@freebsd.org Received: from lor.watermarkgroup.com (lor.watermarkgroup.com [207.202.73.33]) by hub.freebsd.org (Postfix) with ESMTP id EB4E015819 for ; Wed, 21 Apr 1999 00:55:41 -0700 (PDT) (envelope-from luoqi@watermarkgroup.com) Received: (from luoqi@localhost) by lor.watermarkgroup.com (8.8.8/8.8.8) id DAA22828 for current@freebsd.org; Wed, 21 Apr 1999 03:53:13 -0400 (EDT) (envelope-from luoqi) Date: Wed, 21 Apr 1999 03:53:13 -0400 (EDT) From: Luoqi Chen Message-Id: <199904210753.DAA22828@lor.watermarkgroup.com> To: current@freebsd.org Subject: egcs bug caused ftp hang problem Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG An egcs optimizer bug caused incorrect tcp checksum recalculation in libalias for the rewritten PORT command packet and the server subsequently discard the packet. The following piece of C code (from TcpChecksum() in alias_util.c) u_short *ptr; int sum, oddbyte; oddbyte = 0; *((u_char *) &oddbyte) = *(u_char *) ptr; sum += oddbyte; is compiled into (%esi = ptr, %ecx = sum) 0x28067038 : movb (%esi),%al 0x2806703a : addl %eax,%ecx egcs should have zeroed %eax before the movb. libalias compiled without -O works correctly. -lq To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message