Bug 31497 - Internal compiler error
Summary: Internal compiler error
Status: RESOLVED DUPLICATE of bug 35731
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 RC4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-10 17:12 EST by Mark Brodhun CLA
Modified: 2003-03-27 09:22 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Brodhun CLA 2003-02-10 17:12:18 EST
About 4 or 5 times a day for the last week (2.1 M4), on save, I get a dialog
that says "save failed:null". In the task list I get an error: "internal
compiler failure" and flags the packeage declaration of the current Java class.
The below entry from the .log file shows the exception trace. I haven't been
able to detect a sequence of events that cause this, nor have I figured out how
I get it out of this mode (shutting down, restarting doesn't help). Occasionally
it starts working again but I can't determine what does it. Currently I can't
get rid of the error for anything. I've seen the error move from one file to
another by shutting down and restarting. I've also see doing a save clear up the
error in the current file but immeadiately show up in another file after a save.
I've started 2.1 M3 on this work space and get the same errors (always
complaining about the package declaration). Please help.

!ENTRY org.eclipse.ui 4 4 Feb 10, 2003 15:09:45.65
!MESSAGE Save Failed
!ENTRY org.eclipse.ui 2 0 Feb 10, 2003 15:09:45.75
!MESSAGE Save Failed
!STACK 0
java.lang.NullPointerException
	at java.lang.String.<init>(String.java(Compiled Code))
	at
org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java(Compiled
Code))
	at
org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java(Compiled
Code))
	at
org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java(Compiled
Code))
	at
org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java(Compiled
Code))
	at
org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java(Compiled
Code))
	at
org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java(Compiled
Code))
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:947)
	at
org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:39)
	at
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:825)
	at
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.methods(SourceTypeBinding.java:687)
	at
org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.faultInTypesForFieldsAndMethods(SourceTypeBinding.java:345)
	at
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:279)
	at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:578)
	at
org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:204)
	at
org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:90)
	at
org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent(CompilationUnit.java:664)
	at org.eclipse.jdt.internal.core.WorkingCopy.reconcile(WorkingCopy.java:446)
	at org.eclipse.jdt.internal.core.WorkingCopy.reconcile(WorkingCopy.java:421)
	at
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.doSaveDocument(CompilationUnitDocumentProvider.java:903)
	at
org.eclipse.ui.texteditor.AbstractDocumentProvider.saveDocument(AbstractDocumentProvider.java:454)
	at
org.eclipse.ui.texteditor.AbstractTextEditor$11.execute(AbstractTextEditor.java:2772)
	at
org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:65)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1564)
	at
org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:79)
	at
org.eclipse.ui.texteditor.AbstractTextEditor.performSaveOperation(AbstractTextEditor.java:2790)
	at
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.performSaveOperation(CompilationUnitEditor.java:849)
	at
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSave(CompilationUnitEditor.java:913)
	at org.eclipse.ui.internal.EditorManager$11.run(EditorManager.java:1032)
	at org.eclipse.ui.internal.EditorManager$8.run(EditorManager.java:901)
	at
org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:296)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:246)
	at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:432)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:65)
	at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:429)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1174)
	at
org.eclipse.ui.internal.EditorManager.runProgressMonitorOperation(EditorManager.java:907)
	at org.eclipse.ui.internal.EditorManager.saveEditor(EditorManager.java:1037)
	at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:2143)
	at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:30)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:769)
	at
org.eclipse.ui.internal.WWinKeyBindingService.invoke(WWinKeyBindingService.java:139)
	at
org.eclipse.ui.internal.WWinKeyBindingService.pressed(WWinKeyBindingService.java:120)
	at
org.eclipse.ui.internal.WWinKeyBindingService$6.widgetSelected(WWinKeyBindingService.java:376)
	at org.eclipse.ui.internal.AcceleratorMenu$2.handleEvent(AcceleratorMenu.java:55)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code))
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code))
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1429)
	at
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
	at org.eclipse.core.launcher.Main.run(Main.java:703)
	at org.eclipse.core.launcher.Main.main(Main.java:539)
Comment 1 Philipe Mulet CLA 2003-02-10 17:47:11 EST
An internal compiler error is always reported against position 0 of the 
compilation unit (likely package statement line). However it has nothing to do 
with the package statement per se.

Could you provide a source sample which reproduces it ? 

The stack trace doesn't provide line numbers, and the String constructor seems 
suspicious since the code should not perform any String manipulation (only char
[]s).

Comment 2 Mark Brodhun CLA 2003-02-10 18:01:43 EST
I doubt this will help but the below is the complete contents of the last file
that had the internal compiler error. The error moved from another file to this
file after I shut down and restarted Eclipse (W2k IBM JRE 1.3.1). As I said this
error comes in at random times and I don't think it has anything to do with one
particular file. I have seen related error traces that say error in the
org.eclipse.core.resources package but it isn't currently failing so I can't get
the exact msg for you. In all cases it is due to a save operation generating the
null pointer exception in the string constructor.



package com.ibm.edts.tcrepos; 
 
/**
 * 
 */
public interface ESDTConstants {
	public static final String ATTR_COM_IBM_EDTS_PRODUCT = "com.ibm.edts.product";
	public static final String ATTR_COM_IBM_EDTS_RELEASE = "com.ibm.edts.release";
	
	public static final String REPOS_NAME = "com.ibm.edts.directoryartifacts";
	public static final String ATTR_COM_IBM_ESDT_CRTDATE = "com.ibm.edts.crtDate";

}
Comment 3 Philipe Mulet CLA 2003-02-10 18:19:11 EST
It feels highly unlikely that this code would cause such a grief. I am 
wondering if you aren't rather seeing a VM bug.

Could you try to use a different JRE and see if it occurs again ? There have 
been numerous unexpected NPEs using certain IBM 1.3.1 builds.
Comment 4 Philipe Mulet CLA 2003-02-11 06:21:20 EST
Cannot reproduce on JRE 1.4.1_01
Comment 5 Philipe Mulet CLA 2003-02-12 06:52:12 EST
Closing, please reopen if you have more evidence than the compiler is guilty.
Comment 6 Philipe Mulet CLA 2003-03-27 07:12:57 EST
Reopen to workaround
Comment 7 Philipe Mulet CLA 2003-03-27 07:13:15 EST

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