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

Bug 289463

Summary: ArrayIndexOutOfBoundsException: 2048 when autocompleting (apart from other random operations)
Product: [Eclipse Project] JDT Reporter: Craig <craighewetson>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug
Attachments:
Description Flags
SavedIndexNames none

Description Craig CLA 2009-09-15 09:59:10 EDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.14) Gecko/2009090216 Ubuntu/9.04 (jaunty) Firefox/3.0.14
Build Identifier: I20090611-1540

Error
Tue Sep 15 15:54:20 SAST 2009
An internal error occurred during: "Cache refresh".

java.lang.ArrayIndexOutOfBoundsException: 2048
	at org.eclipse.jdt.internal.core.index.DiskIndex.readStreamInt(DiskIndex.java:958)
	at org.eclipse.jdt.internal.core.index.DiskIndex.readHeaderInfo(DiskIndex.java:779)
	at org.eclipse.jdt.internal.core.index.DiskIndex.initialize(DiskIndex.java:379)
	at org.eclipse.jdt.internal.core.index.Index.<init>(Index.java:96)
	at org.eclipse.jdt.internal.core.search.indexing.IndexManager.getIndex(IndexManager.java:248)
	at org.eclipse.jdt.internal.core.search.indexing.IndexManager.getIndexes(IndexManager.java:309)
	at org.eclipse.jdt.internal.core.search.PatternSearchJob.getIndexes(PatternSearchJob.java:81)
	at org.eclipse.jdt.internal.core.search.PatternSearchJob.ensureReadyToRun(PatternSearchJob.java:50)
	at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(JobManager.java:174)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.searchAllTypeNames(BasicSearchEngine.java:1122)
	at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames(SearchEngine.java:713)
	at org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog$ConsistencyRunnable.refreshSearchIndices(FilteredTypesSelectionDialog.java:653)
	at org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog$ConsistencyRunnable.run(FilteredTypesSelectionDialog.java:636)
	at org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog.reloadCache(FilteredTypesSelectionDialog.java:679)
	at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$RefreshCacheJob.run(FilteredItemsSelectionDialog.java:1502)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Reproducible: Always




eclipse.buildId=I20090611-1540
java.version=1.6.0_16
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_ZA
Command-line arguments:  -os linux -ws gtk -arch x86 -data /home/craig/projects/vastech/ngmc/dev/workspace
Comment 1 Craig CLA 2009-09-15 10:00:36 EDT
Also happens on startup and shutdown of eclipse workbench
Comment 2 Olivier Thomann CLA 2009-09-15 10:07:58 EDT
Would you have steps to reproduce ?
Comment 3 Olivier Thomann CLA 2009-09-15 10:26:53 EDT
Kent, please investigate.
Comment 4 Kent Johnson CLA 2009-09-15 11:13:48 EDT
Have you changed eclipse builds recently ? Or had any crashes ?

It appears the index file for one of your projects is corrupt.


Removing the file workspace\plugins\.metadata\.plugins\org.eclipse.jdt.core\savedIndexNames.txt

will rebuild all of your index files.


But before you delete it, please backup the *.index files if we need them to debug this problem.
Comment 5 Craig CLA 2009-09-15 13:13:20 EDT
Created attachment 147228 [details]
SavedIndexNames
Comment 6 Craig CLA 2009-09-15 13:16:10 EDT
Deleting the above file fixed the problem.
The workspace was used in by eclipse 3.4.2 and I reused it after upgrading to eclipse 3.5.

NOTE:
I've saved the entire folder: org.eclipse.jdt.core, for debugging.
Comment 7 Kent Johnson CLA 2009-09-15 14:54:39 EDT
Sorry but the SavedIndexNames.txt is not the file we need.

Its the corrupt .index file, but since we do not know which one - we would need them all.

Can you zip them up & attach them. thx
Comment 8 Craig CLA 2009-09-15 15:17:04 EDT
Do these index files reveal any of the source code? Filenames will be ok but I would get in trouble if content is exposed. 

Also there is 95 of these files. Is there a way to determine which file is corrupt?
Comment 9 Kent Johnson CLA 2009-09-15 15:30:24 EDT
No there is no source code in an index file.


As for finding out which file is corrupt, you could replace 10-20 of the ones in your current directory at a time, with the old ones & restart your workspace - then do a workspace-wide search.

You could try to narrow down the file that way but I cannot say its definitely going to find the one that is corrupt.
Comment 10 Olivier Thomann CLA 2011-03-29 09:15:24 EDT
Satyam, didn't you fix this ?
Comment 11 Satyam Kandula CLA 2011-03-30 00:40:50 EDT
(In reply to comment #10)
> Satyam, didn't you fix this ?
I haven't fixed this kind of problem. IMHO, the index file would have got truncated.
Comment 12 Eclipse Genie CLA 2020-01-17 11:43:10 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.