Bug 13527 - NPE + GP switching JRE
Summary: NPE + GP switching JRE
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: Other Linux-Motif
: P3 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-11 10:48 EDT by Jared Burns CLA
Modified: 2002-04-26 06:20 EDT (History)
0 users

See Also:


Attachments
javacore.txt - the java core file generated when Eclipse crashes (38.28 KB, text/plain)
2002-04-11 10:49 EDT, Jared Burns CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Burns CLA 2002-04-11 10:48:50 EDT
Build 20020409

The following NPE appeared in my OS console when I switched JRE's in my host
from JDK 1.4.0 to IBM 1.3.

java.lang.NullPointerException
	at
org.eclipse.jdt.internal.core.index.impl.IndexerOutput.addRef(IndexerOutput.java(Compiled
Code))
	at
org.eclipse.jdt.internal.core.search.indexing.AbstractIndexer.addTypeReference(AbstractIndexer.java:164)
	at
org.eclipse.jdt.internal.core.search.indexing.AbstractIndexer.addMethodDeclaration(AbstractIndexer.java:116)
	at
org.eclipse.jdt.internal.core.search.indexing.BinaryIndexer.indexClassFile(BinaryIndexer.java:485)
	at
org.eclipse.jdt.internal.core.search.indexing.BinaryIndexer.indexFile(BinaryIndexer.java:513)
	at
org.eclipse.jdt.internal.core.search.indexing.AbstractIndexer.index(AbstractIndexer.java:558)
	at org.eclipse.jdt.internal.core.index.impl.Index.add(Index.java:88)
	at
org.eclipse.jdt.internal.core.search.indexing.AddJarFileToIndex.execute(AddJarFileToIndex.java(Compiled
Code))
	at
org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:298)
	at java.lang.Thread.run(Thread.java:512)


When I then tried to switch the JRE back to JDK 1.4.0, Eclipse crashed completely.

This is a reproducable problem. If I switch from IBM 1.3 to JDK 1.4.0 a few
times, Eclipse always crashes (it can crash when switching in either direction).
Comment 1 Jared Burns CLA 2002-04-11 10:49:25 EDT
Created attachment 579 [details]
javacore.txt - the java core file generated when Eclipse crashes
Comment 2 Philipe Mulet CLA 2002-04-11 11:06:30 EDT
Can you reproduce it ?

The only possible NPE in the offending code would occur at the last line.

	public void addRef(char[] word) {
		if (indexedFile == null) {
			throw new IllegalStateException();
		}
		index.addRef(indexedFile, word); <<<<<<<<<<<<<<
	}

The index field is initialized once in the constructor of the IndexerOutput, 
and never reassigned.

Guessing this could be a VM bug, which would also explain the GPF (a NPE should 
cause one).
Comment 3 Jared Burns CLA 2002-04-11 11:17:17 EDT
Yes, it happens to me consistently running Eclipse on IBM 1.3.1.
Comment 4 Jared Burns CLA 2002-04-11 11:17:55 EDT
Note that I've only seen this in my host. I haven't been able to reproduce the
problem in my target Eclipse (not with a simple "Bonjour, le monde!" anyway).
Comment 5 Philipe Mulet CLA 2002-04-11 12:57:24 EDT
Does it happen too when running on a different VM ?
Comment 6 Jared Burns CLA 2002-04-12 09:32:25 EDT
I've only been able to reproduce it on IBM 1.3.1.
Comment 7 Philipe Mulet CLA 2002-04-16 07:30:45 EDT
Sounds like a VM bug.
Comment 8 Philipe Mulet CLA 2002-04-17 09:30:34 EDT
Can you turn off the jit and see if it still occurs ? Alternatively trying to 
reproduce it under the debugger would also do the trick
Comment 9 Philipe Mulet CLA 2002-04-26 06:20:50 EDT
Closing as a jit bug.