From owner-svn-src-all@FreeBSD.ORG Sun Jan 4 21:53:59 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 435A8C36; Sun, 4 Jan 2015 21:53:59 +0000 (UTC) Received: from mail-pd0-x236.google.com (mail-pd0-x236.google.com [IPv6:2607:f8b0:400e:c02::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09B32283D; Sun, 4 Jan 2015 21:53:59 +0000 (UTC) Received: by mail-pd0-f182.google.com with SMTP id p10so26720638pdj.41; Sun, 04 Jan 2015 13:53:58 -0800 (PST) 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 :message-id:references:to; bh=939G5Qz9ZBATjaPlEh85scHK+s1Qn0sN5I+2fwKKSZI=; b=0pzfsggO7SMBu8iSzMVhJnkTZ6s2zodkmhU2UqEHIJq8v18vu5aaaxAa7t+CUkNTCt sMqbyBjzTHLbIUnk0+GJt4D6sO5ZVQM4thYjK+xuehX6+XgRcXGgkg48rm04Ykhvl7ny X6HjH9ZwouR4+drmBFFOK1Hr2fbEy5sOM4CadhBTatGqGLJOi1fyzdXFwXzlHE7jtccB 1YClhaPmUjfkIJEicAw/hGS1tT4nCTFZtuaEaXUuw5fwnjMvzX6X/MXwfOWj721LXDdC iUWYikgLySAQxJgKplE7djmjDANOGpHFfnL+Zx8UjKxaMyG+0fm5x6eafZyFio0bxtTA SBNQ== X-Received: by 10.66.184.175 with SMTP id ev15mr108339358pac.78.1420408438595; Sun, 04 Jan 2015 13:53:58 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:d0fa:d4cd:367f:233d? ([2601:8:ab80:7d6:d0fa:d4cd:367f:233d]) by mx.google.com with ESMTPSA id ah1sm40239088pad.16.2015.01.04.13.53.57 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 04 Jan 2015 13:53:57 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_EA093892-D0C9-4847-A611-887012DA5B8A"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r276521 - head/contrib/netbsd-tests/lib/libm From: Garrett Cooper In-Reply-To: <20150102185046.K943@besplex.bde.org> Date: Sun, 4 Jan 2015 13:53:52 -0800 Message-Id: <9E7EDF01-88C2-4CB5-B26F-1F557E4441DF@gmail.com> References: <201501020057.t020vf4d063191@svn.freebsd.org> <20150102185046.K943@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jan 2015 21:53:59 -0000 --Apple-Mail=_EA093892-D0C9-4847-A611-887012DA5B8A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Jan 2, 2015, at 0:03, Bruce Evans wrote: > On Fri, 2 Jan 2015, Garrett Cooper wrote: >=20 >> Log: >> Reset errno in :scalbnf_val and :scalbnl_val before running the tests = so the >> tested errno isn't stale >=20 > It is a bug to even test errno. No function in libm accesses errno. I=92ll have to look again, but I=92m pretty sure NetBSD is using this to = test errors dealing with ranges and input, and it=92s probably = implementation dependent. It=92s still interesting that it was setting EINVAL (errno =3D=3D 2) = when running the tests and not others (and that potentially deserves = investigation). What=92s also curious is that this issue doesn=92t manifest itself on = 11-CURRENT as well, but I haven=92t taken the time to figure out why = that is, yet (apart from having merged some revisions from head which = didn=92t affect things), so the underlying issue is probably buried = somewhere in another library (libc, libthr, etc). >> This was needed in order for the test to pass on amd64 with stable/10 >>=20 >> MFC after: 3 days >>=20 >> Modified: >> head/contrib/netbsd-tests/lib/libm/t_scalbn.c >>=20 >> Modified: head/contrib/netbsd-tests/lib/libm/t_scalbn.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/contrib/netbsd-tests/lib/libm/t_scalbn.c Thu Jan 1 = 23:21:46 2015 (r276520) >> +++ head/contrib/netbsd-tests/lib/libm/t_scalbn.c Fri Jan 2 = 00:57:40 2015 (r276521) >> @@ -225,6 +225,9 @@ ATF_TC_BODY(scalbnf_val, tc) >> double rv; >>=20 >> for (i =3D 0; i < tcnt; i++) { >> +#ifdef __FreeBSD__ >> + errno =3D 0; >> +#endif >=20 > This is not FreeBSD-specific. A correct test might test > errno under the condition (math_errhandling & MATH_ERRNO), but that > would be a lot of work to test a fundamentally broken implementation. It definitely isn=92t. It=92s an item that I=92ll need to bring up with = the NetBSD folks/resolve differently in the future. >> rv =3D scalbnf(tests[i].inval, tests[i].exp); >> ATF_CHECK_EQ_MSG(errno, tests[i].error, >> "test %zu: errno %d instead of %d", i, errno, >=20 > The tests might set errno elsewhere, but scalbnf() obviously doesn't > in FreeBSD (and shouldn't unless MATH_ERRNO), so the = ATF_CHECK_EQ_MSG() > test can have no effect. It is surprising that it doesn't sometimes > fail if errno is always 0. If it always succeeds, then tests[i].error > must be dead data (always 0) and the ATF_CHECK_EQ_MSG() test dead code > (always pass). Hmmm=85 How is MATH_ERRNO supposed to work in FreeBSD. Based on = documentation I found =97 = http://en.cppreference.com/w/cpp/numeric/math/math_errhandling =97 it=92s = supposed to be used for reporting errors with errno since c++11, but = that doesn=92t seem to be implemented in libc++/libstdc++ (at least not = based on my limited grep)? FWIW it seems like this value should be 0, = not 1... Thanks! $ grep -r MATH_ERRNO contrib/binutils contrib/gcc* contrib/lib* = contrib/llvm/ include lib sys/sys/ lib/msun/src/math.h:#define MATH_ERRNO 1 contrib/libc++/include/cmath: MATH_ERRNO // C99 $ --Apple-Mail=_EA093892-D0C9-4847-A611-887012DA5B8A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUqbZwAAoJEMZr5QU6S73eXBcH/1NQf+GIElihOz9QhypYVeMs diZH2sinafOeN0lTGk8HJemYU9Q/GaQbK4bYUj5xOxpnl9Fon5wsycs9F1HwXAqI lYFNzsIZFbPSPjY15BAYVdP5Y8QyNWOOnV4Fzh+/SQg1PLwhXNbuOnZS1v0bAfZj mIuUbSQ+3CtGcTfuUg2KirG0AVZ4TtEy2oDrPVX4j+KHySYpGhnicJblox1pQji6 o2T0TIvjrnXKlTq0dPRIZ8AlV28TjnTbRZ1jGXhkUJOSt8W5XZzZl0jqy+TEUqA+ +uZvIBysKfQGDrazVdwaazeMeos2xlAxbWw2+Pl7zy71G1U+nx6ky3Esqmrz4SI= =psvE -----END PGP SIGNATURE----- --Apple-Mail=_EA093892-D0C9-4847-A611-887012DA5B8A--