Bug 181475

Summary: [index] Type name search hangs when reading certain index file chunks
Product: [Eclipse Project] JDT Reporter: Pavel Zuev <pzuev>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED DUPLICATE QA Contact:
Severity: critical    
Priority: P3    
Version: 3.3   
Target Milestone: 3.3 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Stack trace
none
Index file to reproduce the problem none

Description Pavel Zuev CLA 2007-04-06 17:51:41 EDT
Build ID: I20070323-1616

Steps To Reproduce:
I have encountered the problem when I tried to use the "Open Type" dialog to find a class - it was just displaying "Searching: 9%" indefinitely until I killed the Eclipse process. 
I couldn't build the test workspace that could expose the bug, but the problem can be reproduced in a test case:

DiskIndex index = new DiskIndex("390905651.index"); // attached index file
index.initialize(true);
index.bufferEnd = 2048; // assign the value with a debugger or make the field non-private
index.readDocumentName(998); // never returns


More information:
I'm attaching the thread stack trace with variable values and the index file. Looks like there is a possibility for an infinite loop inside the org.eclipse.jdt.internal.core.index.DiskIndex.readStreamChars method. 
Moreover, DiskIndex.bufferEnd is never initialized when DiskIndex.readDocumentName is called.
Comment 1 Pavel Zuev CLA 2007-04-06 17:52:37 EDT
Created attachment 63198 [details]
Stack trace
Comment 2 Pavel Zuev CLA 2007-04-06 17:54:24 EDT
Created attachment 63199 [details]
Index file to reproduce the problem
Comment 3 Frederic Fusier CLA 2007-04-07 04:52:35 EDT

*** This bug has been marked as a duplicate of bug 178551 ***
Comment 4 Jerome Lanneluc CLA 2007-04-27 10:40:07 EDT
Verified for 3.3M7 for I20070427-0010