From owner-freebsd-hackers@freebsd.org Thu Oct 8 07:38:20 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6999B9D1C20 for ; Thu, 8 Oct 2015 07:38:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22a.google.com (mail-pa0-x22a.google.com [IPv6:2607:f8b0:400e:c03::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BA811B9 for ; Thu, 8 Oct 2015 07:38:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pacex6 with SMTP id ex6so47120047pac.0 for ; Thu, 08 Oct 2015 00:38:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=OX39QbLljyjp9zWEiLPn1HzLrkAHFNuogaqn5P+Dl+A=; b=H6/CmVHkfQuYd5GRknCUNwBGUElwVS5bZ1IaoMv4cztfVysk3pgPH2fCBcobSQ72RW K6JS1aJTPXC0eEi/dor0mCzo5pbV8OzsOszT3ALzX5ngJK+5z0JLXx6SUfKaewlmrdzj uITzYAED/i5FGDKeGjDdcYVeNoq1cKWXUBeLwDARFkXTBAtAGGhNbG94Lm+obbwomB4s UGcLdq47K7yYNxcZmmlZC4dVgDWQoAGX2ehVLu4L22JhTR6F0ZS2RToiyInUkobU3GvB xCcviovYyWXcI8MQTwpKWIckIA+f3oDX0KwJWz6LfbhKm6jqNL9iMqgMib7xhYmDJANs K0CA== X-Received: by 10.67.30.136 with SMTP id ke8mr6599752pad.16.1444289899879; Thu, 08 Oct 2015 00:38:19 -0700 (PDT) Received: from [33.167.215.6] ([172.56.32.252]) by smtp.gmail.com with ESMTPSA id ot8sm43587110pbb.26.2015.10.08.00.38.19 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Oct 2015 00:38:19 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: Comparing behavior of test-fesetenv.c on AMD Opterons and Intel Xeons: running FNSTENV on Opteron -- should it zero out __x87.__other? From: Garrett Cooper X-Mailer: iPhone Mail (13A452) In-Reply-To: <20151008072444.GO2257@kib.kiev.ua> Date: Thu, 8 Oct 2015 00:38:15 -0700 Cc: "freebsd-hackers@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <20151008072444.GO2257@kib.kiev.ua> To: Konstantin Belousov X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 07:38:20 -0000 > On Oct 8, 2015, at 00:24, Konstantin Belousov wrote:= >=20 > On Wed, Oct 07, 2015 at 05:52:56PM -0700, NGie Cooper wrote: > I removed a lot of text which I am unable to parse. >=20 >> Assertion failed: (memcmp(&env, FE_DFL_ENV, sizeof(env)) =3D=3D 0), >> function test_dfl_env, file test-fenv.c, line 136. >>=20 >> Program received signal SIGABRT, Aborted. >> 0x0000000800b842ca in kill () from /lib/libc.so.7 >> (gdb) frame 3 >> #3 0x0000000000400ec9 in test_dfl_env () at test-fenv.c:136 >> 136 assert(memcmp(&env, FE_DFL_ENV, sizeof(env)) =3D=3D 0); >> (gdb) p env >> $1 =3D {__x87 =3D {__control =3D 4294902655, __status =3D 4294901760, __t= ag =3D >> 4294967295, __other =3D "W\224}\200 >> \000\004\001\250\244D\201;\000\377\377"}, __mxcsr =3D 8064} >> (gdb) p ((fenv_t)__fe_dfl_env) >> $2 =3D {__x87 =3D {__control =3D 4294902655, __status =3D 4294901760, __t= ag =3D >> 4294967295, __other =3D '\000' , "\377\377"}, __mxcsr >> =3D 8064} >=20 > This test is wrong. The __other member of the struct fenv_t is not filled= > by fegetenv(), so it content retains a stack garbage that was there before= > the call. On the other hand, FE_DFL_ENV is explicitely initialized with > zeroes. >=20 > Test must be fixed to compare only meaningful fields of two environments. Hi kib! Ok -- that's what my gut was telling me when I was reading the spec, but I n= eeded a second opinion. Interesting how Intel leaves the __other field alone= and AMD [opterons] don't ;/.. Thanks :)! -NGie=