Bug 174971 - [index] Many exceptions from background indexer
Summary: [index] Many exceptions from background indexer
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
: 175176 175671 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-02-21 10:45 EST by Michael Valenta CLA
Modified: 2007-04-13 06:01 EDT (History)
3 users (show)

See Also:


Attachments
Log file (679.27 KB, application/octet-stream)
2007-02-21 11:48 EST, Michael Valenta CLA
no flags Details
Proposed patch (3.85 KB, patch)
2007-02-21 14:07 EST, Frederic Fusier CLA
no flags Details | Diff
New proposed patch (67.16 KB, patch)
2007-02-22 14:06 EST, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Valenta CLA 2007-02-21 10:45:44 EST
I get one or more of the following exception whenever I perform a CTRL-SHIFT-T and types are missing from the dialog. The build I am using is I20070220-0800.

java.lang.ArrayIndexOutOfBoundsException: 2084
	at org.eclipse.jdt.internal.core.index.DiskIndex.readStreamInt(DiskIndex.java:1033)
	at org.eclipse.jdt.internal.core.index.DiskIndex.readCategoryTable(DiskIndex.java:675)
	at org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategory(DiskIndex.java:434)
	at org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategories(DiskIndex.java:426)
	at org.eclipse.jdt.internal.core.index.DiskIndex.mergeWith(DiskIndex.java:519)
	at org.eclipse.jdt.internal.core.index.Index.save(Index.java:176)
	at org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndex(IndexManager.java:583)
	at org.eclipse.jdt.internal.core.search.indexing.SaveIndex.execute(SaveIndex.java:40)
	at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:372)
	at java.lang.Thread.run(Thread.java:595)
Comment 1 Kent Johnson CLA 2007-02-21 10:51:29 EST
Frederic - we need to pull your latest changes until we can track this down.
Comment 2 Michael Valenta CLA 2007-02-21 10:54:10 EST
Restarting Eclipse seems to have fixed the problem.
Comment 3 Frederic Fusier CLA 2007-02-21 11:07:18 EST
So, it seems not really critical in fact. Can you attach the .log to have the full story of exceptions you got?
Comment 4 Michael Valenta CLA 2007-02-21 11:48:58 EST
Created attachment 59490 [details]
Log file
Comment 5 Frederic Fusier CLA 2007-02-21 12:11:50 EST
I could not reproduce this problem opening many different workspaces with integration build I20070220-1330. Michael cannot reproduce either after having cleaned all index files and restart the workspace.

Unfortunately the .log file does not give more clues while these exceptions occurred

So, I think we can wait a little bit before reverting the change on DiskIndex, but I'll still try to figure out how this AIOOBE can happen...
Comment 6 Frederic Fusier CLA 2007-02-21 14:07:37 EST
Created attachment 59507 [details]
Proposed patch

I think I've found a potential issue which could explain the AIOOBE
Comment 7 Frederic Fusier CLA 2007-02-22 13:57:29 EST
I got the exception in a eclipse 3.0 full source workspace (performance tests) and verified that patch fixes the problem....
Comment 8 Frederic Fusier CLA 2007-02-22 14:06:38 EST
Created attachment 59597 [details]
New proposed patch

This new patch also includes an optimization for write*(...) methods provided by Kent
Comment 9 Frederic Fusier CLA 2007-02-22 14:12:25 EST
The patch also includes added performance tests to highlight the gain with this big change on DiskIndex (several tests in FullSourceWorkspaceSearchTests) and a new test suite FullSourceWorkspaceCompleteSearchTests which performs all possible search request on the eclipse 3.0 full source workspace to verify that the AIOOBE does not occur any longer. Note that this new test suite is not run while running JDT/Core performance tests as it would take too much time.

Released for 3.3 M6 in HEAD stream.
Comment 10 Olivier Thomann CLA 2007-02-22 19:36:51 EST
*** Bug 175176 has been marked as a duplicate of this bug. ***
Comment 11 Frederic Fusier CLA 2007-02-27 05:07:25 EST
*** Bug 175671 has been marked as a duplicate of this bug. ***
Comment 12 Olivier Thomann CLA 2007-03-20 09:28:37 EDT
Verified for 3.3 M6 using build I20070320-0010
Comment 13 Jerome Lanneluc CLA 2007-04-13 06:01:00 EDT
Note that the patch for R3_2_maintenance in bug 171653 also includes a fix for this bug. So this bug doesn't need to be backport to R3_2_maintenance per se.