Community
Participate
Working Groups
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).
Created attachment 579 [details] javacore.txt - the java core file generated when Eclipse crashes
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).
Yes, it happens to me consistently running Eclipse on IBM 1.3.1.
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).
Does it happen too when running on a different VM ?
I've only been able to reproduce it on IBM 1.3.1.
Sounds like a VM bug.
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
Closing as a jit bug.