JDK-8239569 : PublicMethodsTest.java failed due to NPE in java.base/java.nio.file.FileSystems.getFileSystem(FileSystems.java:230)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 15
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux,os_x
  • CPU: x86_64
  • Submitted: 2020-02-20
  • Updated: 2020-07-15
  • Resolved: 2020-04-29
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 15
15 b21Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The following test failed in the JDK15 CI:

java/lang/reflect/PublicMethods/PublicMethodsTest.java

Here's a snippet from the log file:

#section:main
----------messages:(5/148)----------
command: main PublicMethodsTest
reason: User specified action: run main PublicMethodsTest 
Mode: agentvm
Agent id: 5
elapsed time (seconds): 64.509
----------configuration:(9/1042)----------
Boot Layer
  class path: /scratch/mesos/jib-master/install/java/re/jtreg/4.2/promoted/all/b16/bundles/jtreg_bin-4.2.zip/jtreg/lib/javatest.jar 
              /scratch/mesos/jib-master/install/java/re/jtreg/4.2/promoted/all/b16/bundles/jtreg_bin-4.2.zip/jtreg/lib/jtreg.jar 
  patch:      java.base /scratch/mesos/slaves/90726e33-be99-4e27-9d68-25dad266ef13-S2495/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/94243d6a-8e95-452f-ae7f-231cdff5978b/runs/c267f60b-40a5-494f-a8de-85e724d6c5e4/testoutput/test-support/jtreg_open_test_jdk_jdk_lang/patches/java.base

Test Layer
  class path: /scratch/mesos/slaves/90726e33-be99-4e27-9d68-25dad266ef13-S2495/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/94243d6a-8e95-452f-ae7f-231cdff5978b/runs/c267f60b-40a5-494f-a8de-85e724d6c5e4/testoutput/test-support/jtreg_open_test_jdk_jdk_lang/classes/4/java/lang/reflect/PublicMethods/PublicMethodsTest.d
              /scratch/mesos/jib-master/install/jdk-15+11-354/src.full/open/test/jdk/java/lang/reflect/PublicMethods

----------rerun:(30/4014)*----------
cd /scratch/mesos/slaves/90726e33-be99-4e27-9d68-25dad266ef13-S2495/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/94243d6a-8e95-452f-ae7f-231cdff5978b/runs/c267f60b-40a5-494f-a8de-85e724d6c5e4/testoutput/test-support/jtreg_open_test_jdk_jdk_lang/scratch/3 && \\
HOME=/var/folders/_8/j_59_2fn3qsf6y6vm0j4v55m000_dc/T/sparky-temp-home-3598997731454241896/user_home \\
JDK8_HOME=/scratch/mesos/jib-master/install/jdk/13/33/bundles/osx-x64/jdk-13_osx-x64_bin.tar.gz/jdk-13.jdk/Contents/Home \\
JIB_DATA_DIR=/scratch/mesos/jib-master \\
JIB_HOME=/scratch/mesos/jib-master/install/com/oracle/java/jib/jib/3.0-SNAPSHOT/jib-3.0-SNAPSHOT-distribution.zip-1581612312/jib-3.0-SNAPSHOT-distribution \\
JTREG_KEYWORDS="!jfr" \\
JTREG_TIMEOUT_FACTOR=10 \\
JTREG_VERBOSE=fail,error,time \\
LC_ALL=C \\
PATH=/bin:/usr/bin:/usr/sbin \\
TEST_IMAGE_DIR=/scratch/mesos/jib-master/install/jdk-15+11-354/macosx-x64-debug.test \\
TEST_IMAGE_GRAAL_DIR=/scratch/mesos/jib-master/install/jdk-15+11-354/macosx-x64-debug.test/hotspot/jtreg/graal \\
    /scratch/mesos/jib-master/install/jdk-15+11-354/macosx-x64-debug.jdk/jdk-15/fastdebug/bin/java \\
        -Dtest.class.path.prefix=/scratch/mesos/slaves/90726e33-be99-4e27-9d68-25dad266ef13-S2495/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/94243d6a-8e95-452f-ae7f-231cdff5978b/runs/c267f60b-40a5-494f-a8de-85e724d6c5e4/testoutput/test-support/jtreg_open_test_jdk_jdk_lang/classes/4/java/lang/reflect/PublicMethods/PublicMethodsTest.d:/scratch/mesos/jib-master/install/jdk-15+11-354/src.full/open/test/jdk/java/lang/reflect/PublicMethods \\
        -Dtest.src=/scratch/mesos/jib-master/install/jdk-15+11-354/src.full/open/test/jdk/java/lang/reflect/PublicMethods \\
        -Dtest.src.path=/scratch/mesos/jib-master/install/jdk-15+11-354/src.full/open/test/jdk/java/lang/reflect/PublicMethods \\
        -Dtest.classes=/scratch/mesos/slaves/90726e33-be99-4e27-9d68-25dad266ef13-S2495/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/94243d6a-8e95-452f-ae7f-231cdff5978b/runs/c267f60b-40a5-494f-a8de-85e724d6c5e4/testoutput/test-support/jtreg_open_test_jdk_jdk_lang/classes/4/java/lang/reflect/PublicMethods/PublicMethodsTest.d \\
        -Dtest.class.path=/scratch/mesos/slaves/90726e33-be99-4e27-9d68-25dad266ef13-S2495/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/94243d6a-8e95-452f-ae7f-231cdff5978b/runs/c267f60b-40a5-494f-a8de-85e724d6c5e4/testoutput/test-support/jtreg_open_test_jdk_jdk_lang/classes/4/java/lang/reflect/PublicMethods/PublicMethodsTest.d \\
        -Dtest.vm.opts='-Xmx512m -XX:MaxRAMPercentage=5 -ea -esa' \\
        -Dtest.tool.vm.opts='-J-Xmx512m -J-XX:MaxRAMPercentage=5 -J-ea -J-esa' \\
        -Dtest.compiler.opts= \\
        -Dtest.java.opts=-XX:-UseCompressedOops \\
        -Dtest.jdk=/scratch/mesos/jib-master/install/jdk-15+11-354/macosx-x64-debug.jdk/jdk-15/fastdebug \\
        -Dcompile.jdk=/scratch/mesos/jib-master/install/jdk-15+11-354/macosx-x64-debug.jdk/jdk-15/fastdebug \\
        -Dtest.timeout.factor=10.0 \\
        -Dtest.root=/scratch/mesos/jib-master/install/jdk-15+11-354/src.full/open/test/jdk \\
        -Dtest.modules='jdk.compiler jdk.zipfs' \\
        -Dtest.nativepath=/scratch/mesos/jib-master/install/jdk-15+11-354/macosx-x64-debug.test/jdk/jtreg/native \\
        -classpath /scratch/mesos/slaves/90726e33-be99-4e27-9d68-25dad266ef13-S2495/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/94243d6a-8e95-452f-ae7f-231cdff5978b/runs/c267f60b-40a5-494f-a8de-85e724d6c5e4/testoutput/test-support/jtreg_open_test_jdk_jdk_lang/classes/4/java/lang/reflect/PublicMethods/PublicMethodsTest.d:/scratch/mesos/jib-master/install/jdk-15+11-354/src.full/open/test/jdk/java/lang/reflect/PublicMethods:/scratch/mesos/jib-master/install/java/re/jtreg/4.2/promoted/all/b16/bundles/jtreg_bin-4.2.zip/jtreg/lib/javatest.jar:/scratch/mesos/jib-master/install/java/re/jtreg/4.2/promoted/all/b16/bundles/jtreg_bin-4.2.zip/jtreg/lib/jtreg.jar \\
        PublicMethodsTest
----------System.err:(48/3933)----------
java.lang.RuntimeException: java.lang.NullPointerException
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:163)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
	at PublicMethodsTest.compile(PublicMethodsTest.java:250)
	at PublicMethodsTest.lambda$diffResults$19(PublicMethodsTest.java:521)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at PublicMethodsTest.main(PublicMethodsTest.java:74)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
	at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.NullPointerException
	at java.base/java.nio.file.FileSystems.getFileSystem(FileSystems.java:230)
	at jdk.compiler/com.sun.tools.javac.file.Locations$SystemModulesLocationHandler.initSystemModules(Locations.java:1964)
	at jdk.compiler/com.sun.tools.javac.file.Locations$SystemModulesLocationHandler.listLocationsForModules(Locations.java:1939)
	at jdk.compiler/com.sun.tools.javac.file.Locations.listLocationsForModules(Locations.java:2191)
	at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.listLocationsForModules(JavacFileManager.java:1188)
	at java.compiler@15-ea/javax.tools.ForwardingJavaFileManager.listLocationsForModules(ForwardingJavaFileManager.java:205)
	at jdk.compiler/com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager.listLocationsForModules(ClientCodeWrapper.java:398)
	at jdk.compiler/com.sun.tools.javac.code.ModuleFinder$ModuleLocationIterator.hasNext(ModuleFinder.java:138)
	at jdk.compiler/com.sun.tools.javac.code.ModuleFinder.scanModulePath(ModuleFinder.java:291)
	at jdk.compiler/com.sun.tools.javac.code.ModuleFinder.findAllModules(ModuleFinder.java:187)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.getUnnamedModuleCompleter(Modules.java:1423)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.setCompilationUnitModules(Modules.java:473)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.enter(Modules.java:267)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.initModules(Modules.java:233)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.initModules(JavaCompiler.java:1050)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:938)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147)
	... 22 more

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: java.lang.NullPointerException


test result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: java.lang.NullPointerException
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/1d06a4620ea1 User: roland Date: 2020-04-29 15:46:39 +0000
29-04-2020

initial ILW = HMM = P2 Based on above comments, this is recent regression from JDK15b10 onwards with JDK-8231291 fix changeset. Hi [~roland], Request your help to check this task please. Thank you.
21-04-2020

Due to JDK-8231291 Without JDK-8231291, both two tests pass; with it, PublicMethodsTest fail almost every time. To reproduce PublicMethodsTest failure: jtreg -agentvm -v1 -conc:1 -nr -jdk:jdk open/test/jdk/java/lang/Appendable open/test/jdk/java/lang/reflect/PublicMethods
20-04-2020

I tried [~amlu]'s recipe and was able to duplicates the issue in about 1 in 10 attempts, both product and fastdebug builds. There is no assert triggered with the fastdebug build. The same recipe does not duplicate the issue when I run with -XX:TieredStopAtLevel=N set to a value less than 4 so it's possible we have a C2 issue.
20-04-2020

With JDK-8242292, test failure now shows: java.lang.RuntimeException: java.lang.IllegalArgumentException: jrt:/ at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:163) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94) at PublicMethodsTest.compile(PublicMethodsTest.java:250) at PublicMethodsTest.lambda$diffResults$19(PublicMethodsTest.java:521) ... at PublicMethodsTest.main(PublicMethodsTest.java:74) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298) at java.base/java.lang.Thread.run(Thread.java:832) Caused by: java.lang.IllegalArgumentException: jrt:/ at java.base/java.nio.file.FileSystems.getFileSystem(FileSystems.java:230) at jdk.compiler/com.sun.tools.javac.file.Locations$SystemModulesLocationHandler.initSystemModules(Locations.java:1964) ...
19-04-2020

[~bpb] One thing we could do it check getFileSystem(URI) to throw IAE if the URI does not have a scheme. That would turn the NPE into a IAE with the URI string. That said, it's doubtful that javac is calling getFileSystem with a relative URI and that we may be chasing a hotspot issue instead.
07-04-2020

[~alanb] Is my reading of the end of the last sentence of your comment of March 29 "[...] doubtful [...] that we are chasing a hotspot issue instead." as "We are probably chasing a hotspot issue." correct?
07-04-2020

I don't know how this failure could even be possible. A snippet of FileSystems is public static FileSystem getFileSystem(URI uri) { String scheme = uri.getScheme(); for (FileSystemProvider provider: FileSystemProvider.installedProviders()) { if (scheme.equalsIgnoreCase(provider.getScheme())) { // line 230 return provider.getFileSystem(uri); } We know from Locations.java that the parameter uri is equal to URI.create("jrt:/") hence non-null. Secondly the list returned by installedProviders() should be non-null and contain only non-null FileSystemProviders (each of which has a non-null scheme). In any case neither ���scheme��� nor ���provider��� at line 230 should be null.
03-03-2020

I checked the task's stdout and I don't see any signs of file system issues: [2020-02-20T06:28:59,203Z][INFO][pool-3-thread-1][c.o.j.s.e.u.DiskProfiler] Available disk space before execution /dev (devfs): 0 B / 184.0 KiB (0.0%) [2020-02-20T06:28:59,204Z][INFO][pool-3-thread-1][c.o.j.s.e.u.DiskProfiler] Available disk space before execution / (/dev/disk1s1): 92.5 GiB / 233.6 GiB (39.6%) - work directory FS [2020-02-20T06:28:59,204Z][INFO][pool-3-thread-1][c.o.j.s.e.u.DiskProfiler] Available disk space before execution /private/var/vm (/dev/disk1s4): 230.6 GiB / 233.6 GiB (98.7%) The "/" and "/private/var/vm" partitions have lots of disk space. I'm not able to ssh into the test machine to check the local system logs.
20-02-2020