Bug 73254

Summary: AllTypeCache thread dies on runtime exceptions
Product: [Eclipse Project] JDT Reporter: Dirk Baeumer <dirk_baeumer>
Component: UIAssignee: Andre Weinand <andre_weinand>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: douglas.pollock, eclipse, Michael.Valenta, Olivier_Thomann, philippe_mulet
Version: 3.0   
Target Milestone: 3.1 M2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
The VM dump none

Description Dirk Baeumer CLA 2004-09-03 12:17:02 EDT
It seems that the all types cache dies when a runtime exception occurs. This 
led to a deadlock in my situation since the organize import never returned.

java.lang.IllegalMonitorStateException
        at java.lang.Object.notifyAll(Native Method)
        at 
org.eclipse.jdt.internal.core.search.indexing.ReadWriteMonitor.exitRead
(ReadWriteMonitor.java:58)
        at org.eclipse.jdt.internal.core.search.PatternSearchJob.search
(PatternSearchJob.java:119)
        at org.eclipse.jdt.internal.core.search.PatternSearchJob.execute
(PatternSearchJob.java:64)
        at 
org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob
(JobManager.java:260)
        at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames
(SearchEngine.java:870)
        at org.eclipse.jdt.internal.corext.util.AllTypesCache.search
(AllTypesCache.java:526)
        at 
org.eclipse.jdt.internal.corext.util.AllTypesCache$TypeCacher.doSearchTypes
(AllTypesCache.java:197)
        at org.eclipse.jdt.internal.corext.util.AllTypesCache$TypeCacher.run
(AllTypesCache.java:166)
Comment 1 Dirk Baeumer CLA 2004-09-03 12:18:04 EDT
Created attachment 14401 [details]
The VM dump
Comment 2 Dirk Baeumer CLA 2004-09-03 12:18:54 EDT
Wrong component....
Comment 3 Dirk Baeumer CLA 2004-09-03 12:19:41 EDT
Philippe, you might be interested in the exception. 
Comment 4 Kent Johnson CLA 2004-09-15 11:09:31 EDT
Looks like a dup of bug 73226.
Comment 5 Dirk Baeumer CLA 2004-09-15 11:32:08 EDT
The cause is similar. The reason for this PR is that we want to protect the 
thread against these failures.
Comment 6 Dirk Baeumer CLA 2004-09-16 14:52:07 EDT
*** Bug 74082 has been marked as a duplicate of this bug. ***
Comment 7 Douglas Pollock CLA 2004-09-17 16:08:25 EDT
I've seen a similar exception. 
 
java.lang.IllegalMonitorStateException 
 at java.lang.Object.notifyAll(Native Method) 
 at 
org.eclipse.jdt.internal.core.search.indexing.ReadWriteMonitor.exitRead(Unknown 
Source) 
 at org.eclipse.jdt.internal.core.search.PatternSearchJob.search(Unknown 
Source) 
 at 
org.eclipse.jdt.internal.core.search.PatternSearchJob.execute(Unknown Source) 
 at 
org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(Unknown 
Source) 
 at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames(Unknown 
Source) 
 at org.eclipse.jdt.internal.corext.util.AllTypesCache.search(Unknown 
Source) 
 at 
org.eclipse.jdt.internal.corext.util.AllTypesCache$TypeCacher.doSearchTypes(Unknown 
Source) 
 at 
org.eclipse.jdt.internal.corext.util.AllTypesCache$TypeCacher.run(Unknown 
Source) 
Comment 8 Douglas Pollock CLA 2004-09-20 15:22:40 EDT
Is this fix still going to make its way into M2?  I think it is somewhat 
important, as I get this once or twice a day.  Sometimes, it seems to require 
restarting to restore sanity. 
 
Comment 9 Douglas Pollock CLA 2004-09-20 15:23:17 EDT
Oh, and I'm running on a hyper-threading Linux-GTK+ box. 
Comment 10 Kim Horne CLA 2004-09-20 15:36:27 EDT
This bug makes using M2 pretty brutal.  +1
Comment 11 Olivier Thomann CLA 2004-09-20 16:00:33 EDT
Are you using a J9 VM?
Comment 12 Olivier Thomann CLA 2004-09-20 16:03:35 EDT
This looks like a duplicate of bug 73226.
Comment 13 Douglas Pollock CLA 2004-09-20 16:15:17 EDT
J9 with JXEs. 
Comment 14 Kim Horne CLA 2004-09-20 16:19:00 EDT
Plain old vanilla Sun here.
Comment 15 Andre Weinand CLA 2004-09-20 16:36:36 EDT
I cannot fix this, I can only try to protect the thread against the failure.

The failure seems to be new. It occurs in search/indexing.
It did not occur in M1 or 3.0 and we did not change anything in the AllTypesCache since then.
Comment 16 Andre Weinand CLA 2004-09-20 17:12:45 EDT
For 3.1 M2:
Added code so that AllTypeCacher thread no longer dies.