Bug 64076 - Background Indexer Crash Recovery logs many exceptions
Summary: Background Indexer Crash Recovery logs many exceptions
Status: RESOLVED DUPLICATE of bug 57419
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 RC1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-26 07:52 EDT by Ed Merks CLA
Modified: 2004-05-26 09:53 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Merks CLA 2004-05-26 07:52:15 EDT
I've been getting these exceptions for a long time and they still happen 
frequently with M9:

!SESSION May 26, 2004 06:45:33.26 ----------------------------------------------
eclipse.buildId=I200405211200
java.fullversion=J2RE 1.4.1 IBM Windows 32 build cn1411-20030930 (JIT enabled: 
jitc)
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
!ENTRY org.eclipse.jdt.core 4 4 May 26, 2004 06:45:33.26
!MESSAGE Background Indexer Crash Recovery
!STACK 0
java.lang.IllegalArgumentException: Buffer size <= 0
 at java.io.BufferedInputStream.<init>(BufferedInputStream.java(Inlined Compiled 
Code))
 at java.io.BufferedInputStream.<init>(BufferedInputStream.java(Inlined Compiled 
Code))
 at 
org.eclipse.jdt.internal.core.index.DiskIndex.readCategoryTable(DiskIndex.java(C
ompiled Code))
 at 
org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategory(DiskIndex.java:360)
 at 
org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategories(DiskIndex.java:352
)
 at org.eclipse.jdt.internal.core.index.DiskIndex.mergeWith(DiskIndex.java:444)
 at org.eclipse.jdt.internal.core.index.Index.save(Index.java:171)
 at 
org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndex(IndexManage
r.java:491)
 at 
org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndexes(IndexMana
ger.java:533)
 at 
org.eclipse.jdt.internal.core.search.indexing.IndexManager.notifyIdle(IndexManag
er.java:354)
 at 
org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:3
50)
 at java.lang.Thread.run(Thread.java:568)

I'm not sure what causes them.
Comment 1 Kent Johnson CLA 2004-05-26 09:53:59 EDT
From the stack trace, this is the call we are making in DiskIndex:

DataInputStream stream = new DataInputStream(new BufferedInputStream(new 
FileInputStream(getIndexFile())));

The constructor in BufferedInputStream is:

public BufferedInputStream(InputStream in) {
  this(in, defaultBufferSize);
}

which calls:

public BufferedInputStream(InputStream in, int size) {
  super(in);
  if (size <= 0) {
    throw new IllegalArgumentException("Buffer size <= 0");
  }
  buf = new byte[size];
}

We do NOT pass in the buffer size (we use the default) so how can it be <= 0?

Its initialized as:

    private static int defaultBufferSize = 2048;

*** This bug has been marked as a duplicate of 57419 ***