Created attachment 200862 [details] Java test program In openjdk8 (v8.192.26) the Math.asin() method returns wrong values. This can be reproduced by the attached test program (CheckMathIssue.java). Previous versions (e.g. 8.172) did return correct results. The comments in the test program show results of the test program for four different platforms: - FreeBSD 11.2 openjdk8-8.192 - FreeBSD 11.2 openjdk8-8.172 - MacOs 10.14 Oracle JDK 8.192 - Linux OSMC (ARM) 4.14 openjdk8-8.191 The latter three return identical (and correct) results. So, there seems to be a bug in the current version of openjdk8.
This may be related to bug 234579, if not the underlying cause of it. If it is the same issue, please: 1) Set this issue as "Blocks" bug 234579, or 2) Close this issue as a duplicate of 234579, and update the summary of the latter to: java/openjdk8: Math.asin() and StrictMath.asin() broken (affects at least math/geogebra)
Given that it works going back to the previous version, and me noticing the issue on december 12, the bug must have been introduced in one of the following : ------------------------------------------------------------------------ r487219 | glewis | 2018-12-11 04:23:57 +0100 (Di., 11 Dez. 2018) | 5 lines . Fix build on gcc based architectures (e.g. powerpc64) PR: 233883 Submitted by: Piotr Kubaj <pkubaj@anongoth.pl> ------------------------------------------------------------------------ r486983 | glewis | 2018-12-08 20:09:28 +0100 (Sa., 08 Dez. 2018) | 5 lines . Fix SCTP support. PR: 230321 Submitted by: Timo Voelker <timo.voelker@fh-muenster.de> ------------------------------------------------------------------------ r486976 | glewis | 2018-12-08 19:43:56 +0100 (Sa., 08 Dez. 2018) | 5 lines . Fix compilation on powerpc64 PR: 223834 Submitted by: Curtis Hamilton <hamiltcl@verizon.net> ------------------------------------------------------------------------ r486973 | glewis | 2018-12-08 19:35:30 +0100 (Sa., 08 Dez. 2018) | 4 lines . Update to 8u192. PR: 230364 ------------------------------------------------------------------------ r485094 | jkim | 2018-11-16 18:30:17 +0100 (Fr., 16 Nov. 2018) | 7 lines - Fix reversed ccache version detection logic. Enable ccache support. - Use '-pthread' for Clang. Clang supports '-pthread' on all BSDs except for Darwin. [1] Reported by: Achilleas Mantzios <achill@matrix.gatewaynet.com> [1] Tested by: Achilleas Mantzios <achill@matrix.gatewaynet.com> [1] ------------------------------------------------------------------------
This also breaks astro/josm and astro/osmosis. (angles show up as multiples of 90 degrees, or results manifest as NaN)
java@, any opinions or progress? Mfg Tobias
I have seen the same thing, but with Math.atan2 (which is the same as StrictMath.atan2), so that function is also broken. I have seen it working correctly on 1.8.0.162 and 1.8.0.172 and incorrectly on 1.8.0.192b26. I have made a full diff of 1.8.0.162 and 1.8.0.192 in the java.lang native code (implementing StrictMath.c), and there are no differences there, so it might be build-related (maybe clang vs gcc)
I have reverted my openjdk8 package to openjdk8-8.181.13_1 (and locked it to prevent automatic pkg upgrade). It was built locally with a poudriere. That version is the last version I have that is working correctly (with astro/josm and astro/osmosis).
A commit references this bug: Author: glewis Date: Sat Feb 9 07:16:05 UTC 2019 New revision: 492485 URL: https://svnweb.freebsd.org/changeset/ports/492485 Log: . When upgrading to 8u192 the endianess definitions specific to BSD were missed during a large merge of the configuration file. This resulted in, at least, macros affecting maths operations using the big endian rather than the little endian versions. PR: 234689 Changes: head/java/openjdk8/Makefile head/java/openjdk8/files/patch-endian
Fix committed. I tested it with the test program attached to this. If someone can test astro/josm too that would be great.
Thanks Greg! I recompiled and tested in my environment and it works again (including my openhab2-2.4 installation which depends on this package).
(In reply to commit-hook from comment #7) (In reply to Greg Lewis from comment #8) Thanks for the fix. Any plans to merge this to the quarterly branch of ports?