Created attachment 200740 [details] Test program to reproduce the error Running the attached test program gives an error: $ javac Test.java && java Test Exception in thread "main" java.lang.UnsatisfiedLinkError: sun.nio.ch.FileDispatcherImpl.allocate0(Ljava/io/FileDescriptor;J)I at sun.nio.ch.FileDispatcherImpl.allocate0(Native Method) at sun.nio.ch.FileDispatcherImpl.allocate(FileDispatcherImpl.java:84) at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:909) at Test.main(Test.java:11) There is an implementation for allocate0 in src/solaris/native/sun/nio/ch/FileDispatcherImpl.c. I guess it's only a problem with the build system. I'm not 100% sure but I think the program that now throws this error used to work about a year ago.
Seems to be a regression in 8u192. openjdk8-8.181.13_1 works fine. A short note on the test program: Make sure that the file "foo" does not exist before running the test. If you test with 8u181 it creates the file with 1 byte. Afterwards, the error will not occur with 8u192 because the affected code path is only entered if the file needs to be expanded.
Created attachment 200746 [details] A quick fix to fix the runtime error It looks like the following commit was not correctly merged, i.e., jdk/make/mapfiles/libnio/mapfile-bsd: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/f64826e5b775 The easiest fix is using the attached patch. However, the above commit was reverted later: https://bugs.openjdk.java.net/browse/JDK-8202261 and fixed differently. http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/a2361ab40be8
(In reply to Jung-uk Kim from comment #2) I forgot to mention the attached patch replaces java/openjdk8/files/patch-jdk-make-mapfiles-libnio-mapfile-bsd.
(In reply to Jung-uk Kim from comment #2) Can confirm that there is no UnsatisfiedLinkError after applying the patch. Thanks for the quick reply.
(In reply to Stefan Ehmann from comment #4) Yes, the patch fixes the test program.
A commit references this bug: Author: jkim Date: Fri Jan 18 00:47:16 UTC 2019 New revision: 490617 URL: https://svnweb.freebsd.org/changeset/ports/490617 Log: Add a missing symbol in the linker map file. PR: 234593 Changes: head/java/openjdk8/Makefile head/java/openjdk8/files/patch-jdk-make-mapfiles-libnio-mapfile-bsd
I just went ahead and committed the patch. Thanks!