Bug 574754 - CompilerInvocationTests.test002_dash_d fails
Summary: CompilerInvocationTests.test002_dash_d fails
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.21   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.21 M2   Edit
Assignee: Andrey Loskutov CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks: 565083
  Show dependency tree
 
Reported: 2021-07-08 21:20 EDT by Manoj N Palat CLA
Modified: 2021-08-19 06:36 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manoj N Palat CLA 2021-07-08 21:20:04 EDT
From:
https://download.eclipse.org/eclipse/downloads/drops4/I20210707-1800/testresults/html/org.eclipse.jdt.compiler.tool.tests_ep421I-unit-win32-java11_win32.win32.x86_64_11.html

test002_dash_d_option - 1.6	Failure	Unexpected problems [out: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:173) at org.eclipse.jdt.internal.compiler.batch.ClasspathJrt.loadModules(ClasspathJrt.java:206) at org.eclipse.jdt.internal.compiler.batch.ClasspathJrt.initialize(ClasspathJrt.java:193) at org.eclipse.jdt.internal.compiler.batch.ClasspathJsr199.initialize(ClasspathJsr199.java:160) at org.eclipse.jdt.internal.compiler.batch.FileSystem.<init>(FileSystem.java:222) at org.eclipse.jdt.internal.compiler.batch.Main.getLibraryAccess(Main.java:3531) at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:4750) at org.eclipse.jdt.internal.compiler.tool.EclipseCompilerImpl.call(EclipseCompilerImpl.java:99) at org.eclipse.jdt.internal.compiler.tool.EclipseCompiler$1.call(EclipseCompiler.java:196) at org.eclipse.jdt.compiler.tool.tests.AbstractCompilerToolTest.invokeCompiler(AbstractCompilerToolTest.java:118) at org.eclipse.jdt.core.tests.compiler.regression.AbstractBatchCompilerTest.runTest(AbstractBatchCompilerTest.java:599) at org.eclipse.jdt.compiler.tool.tests.CompilerInvocationTests.runTest(CompilerInvocationTests.java:100) at org.eclipse.jdt.compiler.tool.tests.CompilerInvocationTests.test002_dash_d_option(CompilerInvocationTests.java:358) 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:566) at junit.framework.TestCase.runTest(TestCase.java:177) at org.eclipse.jdt.core.tests.junit.extension.TestCase.runTest(TestCase.java:969) at junit.framework.TestCase.runBare(TestCase.java:142) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:130) at junit.framework.TestSuite.runTest(TestSuite.java:241) at junit.framework.TestSuite.run(TestSuite.java:236) at org.eclipse.jdt.core.tests.util.CompilerTestSetup.run(CompilerTestSetup.java:59) at junit.framework.TestSuite.runTest(TestSuite.java:241) at junit.framework.TestSuite.run(TestSuite.java:236) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:43) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) 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 org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:82) at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:73) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67) at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75) at org.eclipse.test.EclipseTestRunner.runTests(EclipseTestRunner.java:226) at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:202) at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:52) at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:35) at org.eclipse.test.CoreTestApplication.start(CoreTestApplication.java:43) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) 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:566) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:654) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1462) at org.eclipse.equinox.launcher.Main.main(Main.java:1435) at org.eclipse.core.launcher.Main.main(Main.java:44) ][err: org.eclipse.jdt.internal.compiler.tool.ExceptionDiagnostic@6aea99e7 ]

junit.framework.AssertionFailedError: Unexpected problems [out: java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:173)
at org.eclipse.jdt.internal.compiler.batch.ClasspathJrt.loadModules(ClasspathJrt.java:206)
at org.eclipse.jdt.internal.compiler.batch.ClasspathJrt.initialize(ClasspathJrt.java:193)
at org.eclipse.jdt.internal.compiler.batch.ClasspathJsr199.initialize(ClasspathJsr199.java:160)
at org.eclipse.jdt.internal.compiler.batch.FileSystem.<init>(FileSystem.java:222)
at org.eclipse.jdt.internal.compiler.batch.Main.getLibraryAccess(Main.java:3531)
at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:4750)
at org.eclipse.jdt.internal.compiler.tool.EclipseCompilerImpl.call(EclipseCompilerImpl.java:99)
at org.eclipse.jdt.internal.compiler.tool.EclipseCompiler$1.call(EclipseCompiler.java:196)
at org.eclipse.jdt.compiler.tool.tests.AbstractCompilerToolTest.invokeCompiler(AbstractCompilerToolTest.java:118)
at org.eclipse.jdt.core.tests.compiler.regression.AbstractBatchCompilerTest.runTest(AbstractBatchCompilerTest.java:599)
at org.eclipse.jdt.compiler.tool.tests.CompilerInvocationTests.runTest(CompilerInvocationTests.java:100)
at org.eclipse.jdt.compiler.tool.tests.CompilerInvocationTests.test002_dash_d_option(CompilerInvocationTests.java:358)
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:566)
at junit.framework.TestCase.runTest(TestCase.java:177)
at org.eclipse.jdt.core.tests.junit.extension.TestCase.runTest(TestCase.java:969)
at junit.framework.TestCase.runBare(TestCase.java:142)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:130)
at junit.framework.TestSuite.runTest(TestSuite.java:241)
Comment 1 Jay Arthanareeswaran CLA 2021-07-09 00:06:49 EDT
This doesn't fail locally. It appears a wrong file path somehow makes its way? 

Andrey, do you have some idea what might be going on?
Comment 2 Andrey Loskutov CLA 2021-07-09 00:18:50 EDT
(In reply to Jay Arthanareeswaran from comment #1)
> This doesn't fail locally. It appears a wrong file path somehow makes its
> way? 
> 
> Andrey, do you have some idea what might be going on?

I noticed, this is only ever failed on Windows machine, but consistently - could be related to concrete JDK/JRE installation (path with spaces, wrong JRE, Windows path separator, content of Windows specific JDK build installation)?
Comment 3 Andrey Loskutov CLA 2021-07-09 01:52:40 EDT
org.eclipse.jdt.internal.compiler.util.JrtFileSystem.JrtFileSystem(File) is initialized with C:\Program Files\Java\jdk-11\lib\modules, and because of that, org.eclipse.jdt.internal.compiler.util.JrtFileSystem.initialize(File) can't properly find the jrt-fs.jar: it resolves it to  file:/C:/Program%20Files/Java/jdk-11/lib/modules/lib/jrt-fs.jar 

The "wrong" path is coming from this code:

locationFiles = standardJavaFileManager.getLocation(StandardLocation.PLATFORM_CLASS_PATH);

in 

org.eclipse.jdt.internal.compiler.tool.EclipseCompilerImpl.handleLocations()
and is related to bug 574181 changes.

The location C:\Program Files\Java\jdk-11\lib\modules is resolved in com.sun.tools.javac.file.Locations.BootClassPathLocationHandler.getPaths().

I haven't checked yet, what will be returned on Linux. I will push possible workaround on Windows, but I honestly have no idea what is expected from standardJavaFileManager.getLocation(StandardLocation.PLATFORM_CLASS_PATH);
Comment 4 Eclipse Genie CLA 2021-07-09 01:53:48 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/182928
Comment 5 Jay Arthanareeswaran CLA 2021-07-12 01:10:21 EDT
(In reply to Andrey Loskutov from comment #3)
> org.eclipse.jdt.internal.compiler.util.JrtFileSystem.JrtFileSystem(File) is
> initialized with C:\Program Files\Java\jdk-11\lib\modules, and because of
> that, org.eclipse.jdt.internal.compiler.util.JrtFileSystem.initialize(File)
> can't properly find the jrt-fs.jar: it resolves it to 
> file:/C:/Program%20Files/Java/jdk-11/lib/modules/lib/jrt-fs.jar 

I see that, eventually, the platform libraries are computed/returned by

org.eclipse.jdt.internal.compiler.util.Util.collectPlatformLibraries(File)

which could simply mean we are not getting the right value from java.home. But then why only this test is something I don't know.
Comment 7 Andrey Loskutov CLA 2021-07-24 12:58:30 EDT
(In reply to Eclipse Genie from comment #6)
> Gerrit change https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/182928 was
> merged to [master].
> Commit:
> http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/
> ?id=d4d1518755e0dabbf5e446adb4e4a0c1a3202705

@Jay: I've managed to push that to both Gerrit & at same time merge that to the master branch somehow, without even approving on gerrit. I hope you don't mind, the patch should fix the problem now. If you are not OK with that, feel free to revert.
Comment 9 Jay Arthanareeswaran CLA 2021-07-26 01:23:47 EDT
(In reply to Andrey Loskutov from comment #7)
> @Jay: I've managed to push that to both Gerrit & at same time merge that to
> the master branch somehow, without even approving on gerrit. I hope you
> don't mind, the patch should fix the problem now. 

Not at all. Thanks for taking care of this!
Comment 10 Eclipse Genie CLA 2021-07-26 06:45:16 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/183375
Comment 12 Jay Arthanareeswaran CLA 2021-08-19 06:36:12 EDT
Verified for 4.21 M3 using build I20210818-1800