Repository navigation
Fix mmap detection with new autoconf, service files, ResolverCache and Thread locals - #59
duncanmcqueen wants to merge 4 commits into
Conversation
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 <noreply@anthropic.com> Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
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 <noreply@anthropic.com> Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
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 <noreply@anthropic.com> Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
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 <noreply@anthropic.com> Signed-off-by: duncanmcqueen <206344294+duncanmcqueen@users.noreply.github.com>
a4ba6c6 to
04e9ee1
Compare
|
Hi @duncanmcqueen, thanks a lot for this, and for the detailed write-up. I’m happy to work with you and see if we can get these changes merged, but first I have one request: could you split this into separate PRs, one per fix? We try to keep each PR to a single topic. That way each one can be reviewed and discussed on its own, and merged as soon as it’s ready without waiting on the others. Also, a way to reproduce each issue would be very helpful: steps to reproduce for the build fixes, or a small test case for the runtime ones. Btw, in the PR description you mention a command line test. We use malva for testing Classpath, including in CI. You might want to take a look at it if you're interested. |
|
Thank you for the review and for the information about malva. I split this pull request into one pull request for each fix:
Each pull request has steps to reproduce or a small test case, and the results before and after the change. I reproduced #62, #63 and #64 on Linux with JamVM and the #65 is different: it occurs only with Kaffe, which makes the main The tests are standalone programs with a I close this pull request, because the four new pull requests replace it. 🤖 Generated with Claude Code |
|
Thank you. Let's continue the discussion in the individual PRs. |
Summary
This pull request has two build fixes and two run-time fixes.
AC_CHECK_FUNCSlist,statvfs \has two spaces after the backslash. Thus the backslash quotes a space, not the newline. Autoconf 2.72 and later then check for " mmap" and not for "mmap".HAVE_MMAPis not defined, andFileChannel.map()fails. (OpenTypeFontPeermaps its font files, so all fonts fail.)glibj.zipgets the old service files from the source tree, not the files that configure makes from the*.intemplates. For example, theMixerProviderlist is empty. Now the rule also copies the configured files from the build tree.Threadobject of the main thread without a constructor. Thenlocalsisnull, and eachThreadLocalfails. NowgetThreadLocals()makes the map when it isnull.Tests
I built GNU Classpath with these changes on Haiku (autoconf 2.73, automake 1.19, libtool 2.6) and used it with Kaffe. A command line test (collections, formatting,
BigDecimal, regex, files, threads,ThreadLocal, processes, network) passes. I did not test on Linux.AI assistance
An AI model (Claude Code, by Anthropic) wrote these changes and this text. The repository owner directed the work. Please review the changes as you review other contributions.
The commits do not have a
Signed-off-byline. If you need one, the owner will add it.🤖 Generated with Claude Code