Skip to content

java.lang.StackOverflowError during "Requesting Java AST from selection" #3273

@nlisker

Description

@nlisker

Eclipse soft crashes during hover over some fields with a SOE and asks to restart. This also breaks the compilation, as after this error, many red lines appear saying that various methods can't be found suddenly.
image
image

The first lines of the stack traces are different every time, but the recursion is always the same. Here is the log with various cases of these errors: crashes.log

Here is the infinite recursion (I don't know what the entry point was):

	at org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:365)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.accept(CompilationUnitResolver.java:226)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.accept(CompilationUnitResolver.java:221)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:391)
	at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:275)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport(CompilationUnitScope.java:643)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.resolveImports(CompilationUnitScope.java:325)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.checkAndSetImports(CompilationUnitScope.java:284)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment$CompleteTypeBindingsSteps.perform(LookupEnvironment.java:191)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:602)
	at org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:365)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.accept(CompilationUnitResolver.java:226)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.accept(CompilationUnitResolver.java:221)

While I can reproduce this 100% of the times, unfortunately I didn't manage to create a minimal example despite many hours of chopping off parts of the big project where this occurs. This is because the error becomes harder and harder to reproduce the more code is removed, which means that there is a certain load affecting this issue.
I can't post a whole project here, but if there is a way to send the project or post it somewhere private I will do so.

Tested on
Eclipse 4.33 and also build id: I20241101-1800
Java 22
Win 10

Metadata

Metadata

Labels

bugSomething isn't workingjpms

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions