Bug 63780 - NPE in Indexer
Summary: NPE in Indexer
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 RC1   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-25 00:18 EDT by Wassim Melhem CLA
Modified: 2004-05-27 10:36 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 Wassim Melhem CLA 2004-05-25 00:18:29 EDT
Build: M9

I launched a runtime workbench and low and behold I got the following NPE upon 
startup.

Error May 25, 2004 00:02:43.381 Background Indexer Crash Recovery
java.lang.NullPointerException
at java.io.DataInputStream.readUTF(DataInputStream.java:639)
at java.io.DataInputStream.readUTF(DataInputStream.java:610)
at org.eclipse.jdt.internal.core.index.DiskIndex.readChunk(DiskIndex.java:553)
at org.eclipse.jdt.internal.core.index.DiskIndex.readAllDocumentNames
(DiskIndex.java:485)
at org.eclipse.jdt.internal.core.index.DiskIndex.addDocumentNames
(DiskIndex.java:84)
at org.eclipse.jdt.internal.core.index.Index.queryDocumentNames(Index.java:151)
at org.eclipse.jdt.internal.core.search.indexing.AddJarFileToIndex.execute
(AddJarFileToIndex.java:117)
at org.eclipse.jdt.internal.core.search.processing.JobManager.run
(JobManager.java:367)
at java.lang.Thread.run(Thread.java:534)
Comment 1 Kent Johnson CLA 2004-05-25 09:32:00 EDT
Which VM are you running?
Comment 2 Kent Johnson CLA 2004-05-25 10:41:43 EDT
Here's the code in DataInputStream that we call:

public final String readUTF() throws IOException {
  return readUTF(this); // line 610
}

public final static String readUTF(DataInput in) throws IOException {
  int utflen = in.readUnsignedShort();
  StringBuffer str = new StringBuffer(utflen);
  byte bytearr [] = new byte[utflen];
  int c, char2, char3;
  int count = 0;
  in.readFully(bytearr, 0, utflen); // line 639
  ...
}

So how do we get a NPE at line 639?

Its possible if the parameter 'in' is null, but its 'this' from line 610...

Suspect that this is a VM JIT bug.
Comment 3 Wassim Melhem CLA 2004-05-25 12:54:57 EDT
was using Sun's 1.4.2 at the time.
Comment 4 Kent Johnson CLA 2004-05-27 10:36:42 EDT
I'm going to close this since the stack trace is pretty clear that its a VM 
JIT problem.