Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 543583

Summary: [new index] Deadlock searching for subtypes of a interface
Product: [Eclipse Project] JDT Reporter: Gayan Perera <gayanper>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: critical    
Priority: P3 CC: loskutov
Version: 4.10   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard: stalebug
Attachments:
Description Flags
Thread Dump none

Description Gayan Perera CLA 2019-01-18 10:13:46 EST
Created attachment 277197 [details]
Thread Dump

This doesn't happen on all the classes but on some interfaces the IDE freeze. Seems like the TypeHierarchy search is in a deadlock.

Eclipse Version: 4.11
Build id: I20190114-1800
Java: OpenJDK 11

Example:

1. Open org.eclipse.recommenders.utils.names.ITypeName
2. Open "Quick Type Hierarchy" by pressing CTRL+T
3. Eclipse freeze until it killed of manually.

"ModalContext" #54 prio=6 os_prio=0 cpu=69.90ms elapsed=85.24s tid=0x00007f725d2e8000 nid=0x4f49 in Object.wait()  [0x00007f71fc651000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(java.base@11/Native Method)
	- waiting on <no object reference available>
	at org.eclipse.core.internal.jobs.Semaphore.acquire(Semaphore.java:42)
	- waiting to re-lock in wait() <0x00000000d11ce230> (a org.eclipse.core.internal.jobs.Semaphore)
	at org.eclipse.core.internal.jobs.JobManager.join(JobManager.java:897)
	at org.eclipse.core.internal.jobs.InternalJob.join(InternalJob.java:348)
	at org.eclipse.core.runtime.jobs.Job.join(Job.java:608)
	at org.eclipse.jdt.internal.core.nd.indexer.Indexer.waitForIndex(Indexer.java:1025)
	at org.eclipse.jdt.internal.core.nd.indexer.Indexer.waitForIndex(Indexer.java:1046)
	at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.newSearchAllPossibleSubTypes(IndexBasedHierarchyBuilder.java:514)
	at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.searchAllPossibleSubTypes(IndexBasedHierarchyBuilder.java:499)
	at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.determinePossibleSubTypes(IndexBasedHierarchyBuilder.java:456)
	at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build(IndexBasedHierarchyBuilder.java:157)
	at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute(TypeHierarchy.java:323)
	at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1319)
	- locked <0x00000000d11bf9c8> (a org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy)
	at org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.java:94)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:736)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:802)
	at org.eclipse.jdt.internal.core.BinaryType.newTypeHierarchy(BinaryType.java:898)
	at org.eclipse.jdt.internal.core.BinaryType.newTypeHierarchy(BinaryType.java:857)
	at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.createTypeHierarchy(TypeHierarchyLifeCycle.java:304)
	at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.doHierarchyRefresh(TypeHierarchyLifeCycle.java:335)
	at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle$1.run(TypeHierarchyLifeCycle.java:206)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Comment 1 Gayan Perera CLA 2019-01-18 10:17:41 EST
Seems like "Rebuild Java Index) solves the issue. But may be its worth to investigate why this happens and try to make the eclipse not to freeze and may be trigger a java index rebuild under the hood.
Comment 2 Andrey Loskutov CLA 2019-01-18 11:12:59 EST
You are using "new index". Any special reason for that?
Comment 3 Gayan Perera CLA 2019-01-18 11:54:24 EST
Well i thought the "New Index" is much faster than the old one.
Comment 4 Eclipse Genie CLA 2021-01-08 12:50:53 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Gayan Perera CLA 2021-01-08 14:29:59 EST
@Andrey i think we can close this bug since we don't have plan to use the new index implementation right ? because i saw that the toggle is also removed now.
Comment 6 Andrey Loskutov CLA 2021-01-08 14:35:35 EST
Right. The code is still there, but it can't be activated.