Community
Participate
Working Groups
No steps to reproduce yet. This happens on 4.21. I suspect it's something with an archive on the classpath. !ENTRY org.eclipse.core.jobs 4 2 2021-10-26 15:17:58.563 !MESSAGE An internal error occurred during: "Java Search". !STACK 0 java.lang.StackOverflowError at java.base/java.util.HashMap.getNode(HashMap.java:567) at java.base/java.util.HashMap.get(HashMap.java:552) at org.eclipse.jdt.internal.core.JavaModelManager.getArchiveValidity(JavaModelManager.java:3392) at org.eclipse.jdt.internal.core.JavaModelManager.getArchiveValidity(JavaModelManager.java:3413) at org.eclipse.jdt.internal.core.JavaModelManager.getArchiveValidity(JavaModelManager.java:3413) at org.eclipse.jdt.internal.core.JavaModelManager.getArchiveValidity(JavaModelManager.java:3413) ...
Looks like an issue in the code: ---- try { ZipFile zipFile = getZipFile(path, false); closeZipFile(zipFile); removeFromInvalidArchiveCache(path); } catch (CoreException e) { // Archive is still invalid, fall through to reporting it is invalid. } // Retry the test from the start, now that we have an up-to-date result return getArchiveValidity(path); ---- removeFromInvalidArchiveCache should probably be in a finally code block
(In reply to Gunnar Wagenknecht from comment #1) > Looks like an issue in the code: > ---- > try { > ZipFile zipFile = getZipFile(path, false); > closeZipFile(zipFile); > removeFromInvalidArchiveCache(path); > } catch (CoreException e) { > // Archive is still invalid, fall through to reporting it is invalid. > } > // Retry the test from the start, now that we have an up-to-date result > return getArchiveValidity(path); > ---- > > removeFromInvalidArchiveCache should probably be in a finally code block Looks like this is missing, or better addInvalidArchive() call. The problem you see could be a regression from bug 571340, which touched code around this topic (but not exact this try/catch block). If you could provide steps reproduce, would be nice, but beside this it looks like the getZipFile() throws CoreException trying to access the (out of date) archive and that invalid entry is never cleaned up or updated.
i faced it myself when debugging, standing at breakpoints for more then 2 min. https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/184542 contains a solution.
(In reply to Jörg Kubitz from comment #3) > i faced it myself when debugging, standing at breakpoints for more then 2 > min. > https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/184542 > contains a solution. While this could be a solution, this is a very big change, and I still haven't found time to review it, which most likely means, it is going to 4.23. For the time being, adding addInvalidArchive() call in the empty catch block would also suffice. I can push the patch if there is no better suggestion.
(In reply to Andrey Loskutov from comment #4) > 4.23. For the time being, adding addInvalidArchive() call in the empty catch > block would also suffice. I can push the patch if there is no better > suggestion. I am busy today, but i could extract the essential fix for this somewhen this week if wanted.
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/187082
Gerrit change https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/187082 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=61c79ebdcd4b621eaf7fdc2b991d65447db7ebe2
Verified for Eclipse Version: 2021-12 (4.22) M3 with Build id: I20211110-1800 [by code inspection]
*** Bug 576849 has been marked as a duplicate of this bug. ***