Bug 181475 - [index] Type name search hangs when reading certain index file chunks
Summary: [index] Type name search hangs when reading certain index file chunks
Status: VERIFIED DUPLICATE of bug 178551
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-06 17:51 EDT by Pavel Zuev CLA
Modified: 2007-04-27 10:40 EDT (History)
0 users

See Also:


Attachments
Stack trace (3.14 KB, text/plain)
2007-04-06 17:52 EDT, Pavel Zuev CLA
no flags Details
Index file to reproduce the problem (236.86 KB, application/octet-stream)
2007-04-06 17:54 EDT, Pavel Zuev CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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