Community
Participate
Working Groups
In the Gerrit builds we observe an NPE which can't be: java.lang.NullPointerException at org.eclipse.core.tests.internal.localstore.FileSystemResourceManagerTest.write(FileSystemResourceManagerTest.java:483) at org.eclipse.core.tests.internal.localstore.FileSystemResourceManagerTest.testWriteFile(FileSystemResourceManagerTest.java:380) https://ci.eclipse.org/platform/job/eclipse.platform.resources-Gerrit/1024/testReport/junit/org.eclipse.core.tests.internal.localstore/FileSystemResourceManagerTest/testWriteFile/ The code in FileSystemResourceManagerTest: IWorkspace workspace = getWorkspace(); assertNotNull("workspace cannot be null", workspace); workspace.run(new WriteFileContents(), null); // NPE here !!! HOW it can be an NPE???
Simeon, Stephan: I have really no idea how we can get a NPE here. It can't be, but we see it in Gerrit. Any ideas? Is this something in compiler broken? But why it fails only sporadically? This one is really puzzling.
The stack trace can't be reliable. Even before this, it reported that getWorkspace() returned a null. Only the method throws an illegal state exception instead of returning a null... Unfortunately the rest of the stack traces I've been seeing from bad core resources tests have been all reliable (imagine that). So maybe something in the file is not handled well? I did change the lambda in the method which throws the exception. But this is only *one* lambda... Maybe I should just change all of them , so that we at least know *where* FileSystemResourceManagerTest.testWriteFile() fails?
Do note that before changing the lambda to a class, the NPE was supposed to be somewhere in the lambda expression (again at a very unlikely location): assertNotNull("file system resource manager cannot be null", localManager); localManager.write(file, contents, info, flags, false, null); And I'm rather certain I added the assertNotNull statements because the stack traces were not useful even before any changes.
As discussed on the phone, we think this can only be some weird JUnit framework bug, which doesn't print the *original* exception stack, so we want wrap the entire block into try/catch and print the original NPE to see what is going wrong and where. Simeon will provide a gerrit.
New Gerrit change created: https://git.eclipse.org/r/132987
Gerrit change https://git.eclipse.org/r/132987 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.resources.git/commit/?id=82e79b8688be074e0229c688cdf1f491db7ea844
(In reply to Andrey Loskutov from comment #1) > Simeon, Stephan: I have really no idea how we can get a NPE here. It can't > be, but we see it in Gerrit. Any ideas? Is this something in compiler > broken? But why it fails only sporadically? This one is really puzzling. Did it fail more than once? Would have been interesting to pick up the class file from a failing build. Too late to cry?
once more: https://ci.eclipse.org/platform/job/eclipse.platform.resources-Gerrit/1494/testReport/junit/org.eclipse.core.tests.internal.localstore/AllTests/testWriteFile/ java.lang.NullPointerException at org.eclipse.core.tests.internal.localstore.FileSystemResourceManagerTest.write(FileSystemResourceManagerTest.java:472) at org.eclipse.core.tests.internal.localstore.FileSystemResourceManagerTest.testWriteFile(FileSystemResourceManagerTest.java:362)
full stacktrace from log.txt: !ENTRY org.eclipse.core.resources 4 0 2021-02-11 16:37:06.092 !MESSAGE exception occured during write of file: L/Project0/foo !STACK 0 java.lang.NullPointerException at org.eclipse.core.internal.localstore.FileSystemResourceManager.updateLocalSync(FileSystemResourceManager.java:1094) at org.eclipse.core.internal.localstore.FileSystemResourceManager.write(FileSystemResourceManager.java:1182) at org.eclipse.core.tests.internal.localstore.FileSystemResourceManagerTest$WriteFileContents.run(FileSystemResourceManagerTest.java:511) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2292) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2312) at org.eclipse.core.tests.internal.localstore.FileSystemResourceManagerTest.write(FileSystemResourceManagerTest.java:472) at org.eclipse.core.tests.internal.localstore.FileSystemResourceManagerTest.testWriteFile(FileSystemResourceManagerTest.java:362) 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 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.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) 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.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150) at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124) 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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:206) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:161) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:84) at org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:116) at org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.start(HeadlessTestApplication.java:23) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) 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:653) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) at org.eclipse.equinox.launcher.Main.run(Main.java:1461) at org.eclipse.equinox.launcher.Main.main(Main.java:1434)
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/176170