From owner-freebsd-current@FreeBSD.ORG Tue Dec 18 07:51:27 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3449D16A419 for ; Tue, 18 Dec 2007 07:51:27 +0000 (UTC) (envelope-from Yuriy.Tsibizov@gfk.com) Received: from mx2.gfk.ru (mx2.gfk.ru [84.21.231.139]) by mx1.freebsd.org (Postfix) with ESMTP id ADAE913C447 for ; Tue, 18 Dec 2007 07:51:26 +0000 (UTC) (envelope-from Yuriy.Tsibizov@gfk.com) Received: from ex.hhp.local by mx2.gfk.ru (MDaemon PRO v9.6.0) with ESMTP id md50000728320.msg for ; Tue, 18 Dec 2007 10:52:11 +0300 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Tue, 18 Dec 2007 10:52:06 +0300 Message-ID: <78664C02FF341B4FAC63E561846E3BCC0EEA56@ex.hhp.local> In-Reply-To: <78664C02FF341B4FAC63E561846E3BCC0EEA52@ex.hhp.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: story about lost %ebx (stack corruption in inet_aton ?) thread-index: AchA1XTzC+2gKXXYRPmGbS9V4nLlUAAaYhZQAALFXPA= References: <78664C02FF341B4FAC63E561846E3BCC0EEA52@ex.hhp.local> From: "Yuriy Tsibizov" To: X-Spam-Processed: mx2.gfk.ru, Tue, 18 Dec 2007 10:52:11 +0300 (not processed: message from valid local sender) X-MDRemoteIP: 10.0.0.30 X-Return-Path: Yuriy.Tsibizov@gfk.com X-Envelope-From: Yuriy.Tsibizov@gfk.com X-MDaemon-Deliver-To: freebsd-current@freebsd.org X-MDAV-Processed: mx2.gfk.ru, Tue, 18 Dec 2007 10:52:13 +0300 Subject: RE: story about lost %ebx (stack corruption in inet_aton ?) 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: Tue, 18 Dec 2007 07:51:27 -0000 > My first impression was that there is a bug in gcc compiler on 7-BETA > and 8-CURRENT (i386 only, and only if optimization is enabled), but it > seems to be incorrect. Most probably source is stack corruption in > inet_aton() mistyped, it is inet_network() that fails... testcase: #include #include #include #include #include int main(){ int val; char s[]=3D"10.10.0.10.0/12"; // four dots here! char *q; q =3D strchr(s,'/'); if (q) { *q =3D '\0'; if ((val =3D inet_network(s)) !=3D INADDR_NONE) { printf("OK\n"); return (0); } printf("q=3D %08x\n", q); *q =3D '/'; } } (should be built with -O1 or -O2 to expose that bug) Yuriy.