JDK-8276845 : (fs) java/nio/file/spi/SetDefaultProvider.java fails on x86_32
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 17,18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-11-09
  • Updated: 2021-11-19
  • Resolved: 2021-11-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17 JDK 18
17.0.2Fixed 18 b23Fixed
Related Reports
Relates :  
Description
$ CONF=linux-x86-server-fastdebug make test TEST=java/nio/file/spi/SetDefaultProvider.java

....

Output and diagnostic info for process 944520 was saved into 'pid-944520-output.log'
Error occurred during initialization of VM
java.lang.ExceptionInInitializerError
	at jdk.internal.module.SystemModuleFinders$SystemModuleReader.containsImageLocation(java.base@18-internal/SystemModuleFinders.java:446)
	at jdk.internal.module.SystemModuleFinders$SystemModuleReader.find(java.base@18-internal/SystemModuleFinders.java:457)
	at jdk.internal.loader.BuiltinClassLoader.findResource(java.base@18-internal/BuiltinClassLoader.java:497)
	at jdk.internal.loader.BuiltinClassLoader.findResource(java.base@18-internal/BuiltinClassLoader.java:277)
	at jdk.internal.loader.BootLoader.findResource(java.base@18-internal/BootLoader.java:164)
	at java.lang.Class.getResource(java.base@18-internal/Class.java:2957)
	at java.lang.System.implSetSecurityManager(java.base@18-internal/System.java:420)
	at java.lang.System.initPhase3(java.base@18-internal/System.java:2214)
Caused by: java.lang.UnsupportedOperationException
	at java.nio.file.spi.FileSystemProvider.newFileChannel(java.base@18-internal/FileSystemProvider.java:535)
	at java.nio.channels.FileChannel.open(java.base@18-internal/FileChannel.java:298)
	at java.nio.channels.FileChannel.open(java.base@18-internal/FileChannel.java:357)
	at jdk.internal.jimage.BasicImageReader.<init>(java.base@18-internal/BasicImageReader.java:106)
	at jdk.internal.jimage.ImageReader$SharedImageReader.<init>(java.base@18-internal/ImageReader.java:229)
	at jdk.internal.jimage.ImageReader$SharedImageReader.open(java.base@18-internal/ImageReader.java:243)
	at jdk.internal.jimage.ImageReader.open(java.base@18-internal/ImageReader.java:67)
	at jdk.internal.jimage.ImageReader.open(java.base@18-internal/ImageReader.java:71)
	at jdk.internal.jimage.ImageReaderFactory$1.apply(java.base@18-internal/ImageReaderFactory.java:70)
	at jdk.internal.jimage.ImageReaderFactory$1.apply(java.base@18-internal/ImageReaderFactory.java:67)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(java.base@18-internal/ConcurrentHashMap.java:1708)
	at jdk.internal.jimage.ImageReaderFactory.get(java.base@18-internal/ImageReaderFactory.java:61)
	at jdk.internal.jimage.ImageReaderFactory.getImageReader(java.base@18-internal/ImageReaderFactory.java:85)
	at jdk.internal.module.SystemModuleFinders$SystemImage.<clinit>(java.base@18-internal/SystemModuleFinders.java:385)
	at jdk.internal.module.SystemModuleFinders$SystemModuleReader.containsImageLocation(java.base@18-internal/SystemModuleFinders.java:446)
	at jdk.internal.module.SystemModuleFinders$SystemModuleReader.find(java.base@18-internal/SystemModuleFinders.java:457)
	at jdk.internal.loader.BuiltinClassLoader.findResource(java.base@18-internal/BuiltinClassLoader.java:497)
	at jdk.internal.loader.BuiltinClassLoader.findResource(java.base@18-internal/BuiltinClassLoader.java:277)
	at jdk.internal.loader.BootLoader.findResource(java.base@18-internal/BootLoader.java:164)
	at java.lang.Class.getResource(java.base@18-internal/Class.java:2957)
	at java.lang.System.implSetSecurityManager(java.base@18-internal/System.java:420)
	at java.lang.System.initPhase3(java.base@18-internal/System.java:2214)



[2021-11-09T09:35:14.128465049Z] Waiting for completion for process 944520
[2021-11-09T09:35:14.128535920Z] Waiting for completion finished for process 944520
test SetDefaultProvider.testClassPathWithSecurityManager(): failure
java.lang.AssertionError: expected [true] but found [false]
	at org.testng/org.testng.Assert.fail(Assert.java:99)
	at org.testng/org.testng.Assert.failNotEquals(Assert.java:1037)
	at org.testng/org.testng.Assert.assertTrue(Assert.java:45)
	at org.testng/org.testng.Assert.assertTrue(Assert.java:55)
	at SetDefaultProvider.testClassPathWithSecurityManager(SetDefaultProvider.java:131)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.testng/org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
	at org.testng/org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:599)
	at org.testng/org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174)
	at org.testng/org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
	at org.testng/org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822)
	at org.testng/org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147)
	at org.testng/org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
	at org.testng/org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.testng/org.testng.TestRunner.privateRun(TestRunner.java:764)

Comments
Fix Request (17u) Fixes another x86_32 test. Applies cleanly. Affected test passes.
16-11-2021

Changeset: 0f463a7b Author: Aleksey Shipilev <shade@openjdk.org> Date: 2021-11-10 09:50:27 +0000 URL: https://git.openjdk.java.net/jdk/commit/0f463a7bf73791eda9404882ff63daf9040399bb
10-11-2021

Indeed, see the PR! :)
09-11-2021

We don't test x86 any more so haven't see the issue. As I recall, the image file is not mmap'ed on 32-bit systems, instead the file is opened and positional-reads are used instead. I'll bet the issue is that TestProvider doesn't override newFileChannel so it doesn't delegate it to the built-in provider.
09-11-2021

It fails all the way, starting from the initial test case addition by JDK-8266345.
09-11-2021