From bd13519cb8eab3f637652c681c175f9587ffdb16 Mon Sep 17 00:00:00 2001 From: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com> Date: Wed, 14 Oct 2026 08:26:59 -0500 Subject: [PATCH 1/4] configure.ac: remove spaces after a line continuation In the AC_CHECK_FUNCS list, 'statvfs \' was followed by two spaces, so the backslash quoted a space instead of the newline. Autoconf 2.72 and later then check for ' mmap' instead of 'mmap', HAVE_MMAP is not defined, and FileChannel.map() fails (OpenTypeFontPeer maps its font files this way). Co-Authored-By: Claude Opus 5.5 Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com> --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5c79f3cfd..5adc5774c 100644 --- a/configure.ac +++ b/configure.ac @@ -452,7 +452,7 @@ if test "x${COMPILE_JNI}" = xyes; then gethostbyname_r localtime_r \ strerror_r \ fcntl \ - statvfs \ + statvfs \ mmap munmap mincore msync madvise getpagesize sysconf \ lstat readlink \ inet_aton inet_addr inet_pton \ From 44ac4749b2513f4dfed22a6f9e4f680ac1ffc881 Mon Sep 17 00:00:00 2001 From: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com> Date: Wed, 14 Oct 2026 08:26:59 -0500 Subject: [PATCH 2/4] lib: put the configured service files into glibj.zip The resources rule copies META-INF from the source tree and skips the *.in templates. In an out-of-tree build the files that configure makes from those templates are in the build tree, so glibj.zip got stale copies from the source tree (for example an empty MixerProvider list). Also copy the configured files from the build tree. Co-Authored-By: Claude Opus 5.5 Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com> --- lib/Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Makefile.am b/lib/Makefile.am index 68fed7564..1933a8990 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -98,6 +98,10 @@ resources: copy-vmresources.sh if ! test -d "$$dirname"; then @mkdir_p@ "$$dirname"; fi; \ cp $(top_srcdir)/resource/$$p $$p; \ done + @list=`cd $(top_srcdir)/resource && $(FIND) META-INF -name \*\.in -print`; for p in $$list; do \ + f=`echo $$p | sed -e 's/\.in$$//'`; \ + if test -f $(top_builddir)/resource/$$f; then cp $(top_builddir)/resource/$$f $$f; fi; \ + done @$(SHELL) ./copy-vmresources.sh @list=`cd $(top_srcdir) && $(FIND) gnu/javax/swing/plaf/gtk/icons -name *.png -type f -print`; for p in $$list; do \ dirname=`dirname $$p`; \ From 87d7f45dba8ca334c9dd0a4c4621bbf1c6a9e04c Mon Sep 17 00:00:00 2001 From: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com> Date: Wed, 14 Oct 2026 08:26:59 -0500 Subject: [PATCH 3/4] ResolverCache: make the cache before the TTLs The static initializer computed POSITIVE_TTL and NEGATIVE_TTL first. Reading the security properties for them can resolve a host name, which uses the cache before it exists (NullPointerException). Declare the cache and the kill queue first. Co-Authored-By: Claude Opus 5.5 Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com> --- java/net/ResolverCache.java | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/java/net/ResolverCache.java b/java/net/ResolverCache.java index d7e5ed407..eb8782a6f 100644 --- a/java/net/ResolverCache.java +++ b/java/net/ResolverCache.java @@ -70,6 +70,17 @@ */ class ResolverCache { + /** + * The cache itself. It is declared before the TTLs: computing them can + * load classes that resolve names, and the cache must exist by then. + */ + private static HashMap cache = new HashMap(); + + /** + * List of entries which may expire. + */ + private static LinkedList killqueue = new LinkedList(); + /** * The time in seconds for which successful lookups are cached. */ @@ -94,16 +105,6 @@ private static int getTTL(String propName, int defaultValue) return Integer.parseInt(propValue); } - /** - * The cache itself. - */ - private static HashMap cache = new HashMap(); - - /** - * List of entries which may expire. - */ - private static LinkedList killqueue = new LinkedList(); - /** * Return the hostname for the specified IP address. * From 04e9ee18678c752de3ab7eeeba5b2caa4186992b Mon Sep 17 00:00:00 2001 From: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com> Date: Wed, 14 Oct 2026 08:26:59 -0500 Subject: [PATCH 4/4] Thread: make the thread-local map on first use Some VMs (for example Kaffe) make the Thread object of the main thread without running a constructor, so its locals field is null and every ThreadLocal fails. Make the field non-final and create the map in getThreadLocals() when it is null. Co-Authored-By: Claude Opus 5.5 Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com> --- java/lang/Thread.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java/lang/Thread.java b/java/lang/Thread.java index bc2dbb5b7..cb903fabd 100644 --- a/java/lang/Thread.java +++ b/java/lang/Thread.java @@ -159,7 +159,7 @@ public class Thread implements Runnable /** Thread local storage. Package accessible for use by * InheritableThreadLocal. */ - final ThreadLocalMap locals; + ThreadLocalMap locals; /** The uncaught exception handler. */ UncaughtExceptionHandler exceptionHandler; @@ -1073,7 +1073,10 @@ synchronized void die() */ static ThreadLocalMap getThreadLocals() { - return currentThread().locals; + Thread t = currentThread(); + if (t.locals == null) + t.locals = new ThreadLocalMap(); + return t.locals; } /**