| Summary: | NPE in WorkspaceRoot.findContainersForLocationURI | ||
|---|---|---|---|
| Product: | [Technology] EGit | Reporter: | Dani Megert <daniel_megert> |
| Component: | Core | Assignee: | Project Inbox <egit.core-inbox> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jurgen.vinju, markus.kell.r, matthias.sohn, pwebster, remy.suen, robin.rosenberg, robin |
| Version: | 1.2 | ||
| Target Milestone: | 2.3 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Dani Megert
I have this "all the time". I do have linkedResources in these projects, which may be relevant. I don't know. The other special thing may be that I only have these exceptions in the second level Eclipse that I run. Is there a known workaround? We have further isolated the issue. It is caused by the existence of a linkedResource in a .project file. Without it, the bug does not occur, with the linkedResource the problem hits every time we safe _any_ file in _any_ project. Thanks! Got this during shutdown with EGit 2.1.0.201209190230-r. Looks like the INDEX_DIFF_CACHE_UPDATE job should be cancelled on shutdown. Could this be a duplicate of bug 396900? For supporting linked resources, please see bug 333338. (In reply to comment #4) > Could this be a duplicate of bug 396900? Yes. Ok, closed as duplicate. *** This bug has been marked as a duplicate of bug 396900 *** The fix for bug did not fix this. With 2.3.0.201301242209 I still get NPEs on exit: - ContainerTreeIterator$ResourceEntry.asFile(ContainerTreeIterator.java:346) - WorkspaceRoot.findContainersForLocationURI(WorkspaceRoot.java:89) ENTRY org.eclipse.core.jobs 4 2 2013-01-25 12:48:39.214 !MESSAGE An internal error occurred during: "Re-indexing repository eclipse.jdt.debug". !STACK 0 java.lang.NullPointerException at org.eclipse.egit.core.ContainerTreeIterator$ResourceEntry.asFile(ContainerTreeIterator.java:346) at org.eclipse.egit.core.ContainerTreeIterator$ResourceEntry.getLength(ContainerTreeIterator.java:312) at org.eclipse.jgit.treewalk.WorkingTreeIterator.getEntryLength(WorkingTreeIterator.java:491) at org.eclipse.jgit.treewalk.WorkingTreeIterator.compareMetadata(WorkingTreeIterator.java:749) at org.eclipse.jgit.treewalk.WorkingTreeIterator.isModified(WorkingTreeIterator.java:791) at org.eclipse.jgit.treewalk.filter.IndexDiffFilter.include(IndexDiffFilter.java:221) at org.eclipse.jgit.treewalk.filter.AndTreeFilter$List.include(AndTreeFilter.java:163) at org.eclipse.jgit.treewalk.TreeWalk.next(TreeWalk.java:560) at org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:287) at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.calcIndexDiffDataFull(IndexDiffCacheEntry.java:452) at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.access$5(IndexDiffCacheEntry.java:441) at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$4.run(IndexDiffCacheEntry.java:263) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53) !ENTRY org.eclipse.core.jobs 4 2 2013-01-25 12:48:39.382 !MESSAGE An internal error occurred during: "Re-indexing repository eclipse.platform.team". !STACK 0 java.lang.NullPointerException at org.eclipse.core.internal.resources.WorkspaceRoot.findContainersForLocationURI(WorkspaceRoot.java:89) at org.eclipse.core.internal.resources.WorkspaceRoot.findContainersForLocationURI(WorkspaceRoot.java:80) at org.eclipse.egit.core.IteratorService.findContainer(IteratorService.java:66) at org.eclipse.egit.core.AdaptableFileTreeIterator.createSubtreeIterator(AdaptableFileTreeIterator.java:82) at org.eclipse.jgit.treewalk.AbstractTreeIterator.createSubtreeIterator(AbstractTreeIterator.java:528) at org.eclipse.jgit.treewalk.TreeWalk.enterSubtree(TreeWalk.java:908) at org.eclipse.jgit.treewalk.TreeWalk.next(TreeWalk.java:566) at org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:287) at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.calcIndexDiffDataFull(IndexDiffCacheEntry.java:452) at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.access$5(IndexDiffCacheEntry.java:441) at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$4.run(IndexDiffCacheEntry.java:263) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53) (In reply to comment #7) > The fix for bug did not fix this. With 2.3.0.201301242209 I still get NPEs > on exit: > > - ContainerTreeIterator$ResourceEntry.asFile(ContainerTreeIterator.java:346) Fix for that: https://git.eclipse.org/r/9937 > - WorkspaceRoot.findContainersForLocationURI(WorkspaceRoot.java:89) I don't know how this should be prevented, apart from trying to see if ResourcesPlugin.getWorkspace() throws an ISE before attempting to call findContainersForLocationURI. Or should we join the INDEX_DIFF_CACHE_UPDATE job in IndexDiffCache's dispose? (In reply to comment #8) > (In reply to comment #7) > > The fix for bug did not fix this. With 2.3.0.201301242209 I still get NPEs > > on exit: > > > > - ContainerTreeIterator$ResourceEntry.asFile(ContainerTreeIterator.java:346) > > Fix for that: > > https://git.eclipse.org/r/9937 > > > - WorkspaceRoot.findContainersForLocationURI(WorkspaceRoot.java:89) > > I don't know how this should be prevented, apart from trying to see if > ResourcesPlugin.getWorkspace() throws an ISE before attempting to call > findContainersForLocationURI. > > Or should we join the INDEX_DIFF_CACHE_UPDATE job in IndexDiffCache's > dispose? I think this is the one. merged https://git.eclipse.org/r/#/c/9937/ as 10cdd651b8acef99b4a89a2fc5732d1043d47b5b > Or should we join the INDEX_DIFF_CACHE_UPDATE job in IndexDiffCache's dispose?
The jobs must be cancelled (or waited upon) when the EGit bundle gets stopped. Catching the exception would prevent the NPE, but we would still get the following warning when the core plug-in shuts down:
!ENTRY org.eclipse.core.jobs 2 2 2013-02-01 08:19:00.810
!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$4
(In reply to comment #11) > > Or should we join the INDEX_DIFF_CACHE_UPDATE job in IndexDiffCache's dispose? > > The jobs must be cancelled (or waited upon) when the EGit bundle gets > stopped. We did cancel it already, with the following it should now also be done before continuing: https://git.eclipse.org/r/10097 merged as 116f474cb7cfbd03536e82768a552711f17ff3d8 Verified that this fixes the problem. *** Bug 381858 has been marked as a duplicate of this bug. *** |