Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Oct 2015 00:38:15 -0700
From:      Garrett Cooper <yaneurabeya@gmail.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Comparing behavior of test-fesetenv.c on AMD Opterons and Intel Xeons: running FNSTENV on Opteron -- should it zero out __x87.__other?
Message-ID:  <F04AE220-DF83-44AC-8C23-A36F8D6EB9CA@gmail.com>
In-Reply-To: <20151008072444.GO2257@kib.kiev.ua>
References:  <CAGHfRMBwPfx2rNhHW2xviz59YsEDobjWfemY985PZc3=VM5C6w@mail.gmail.com> <20151008072444.GO2257@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Oct 8, 2015, at 00:24, Konstantin Belousov <kostikbel@gmail.com> 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' <repeats 14 times>, "\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=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F04AE220-DF83-44AC-8C23-A36F8D6EB9CA>