Community
Participate
Working Groups
Eclipse cannot initialize the java editor on big files (more then 207 KB and about 280 KB). When you try second time to open the big file, it caused an Internal Error: A stack overflow error has occured. And you are recommended to exit the workbench. Here comes the .log-file: !ENTRY org.eclipse.ui 4 4 Jul 21, 2004 13:15:17.156 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 Jul 21, 2004 13:15:17.156 !MESSAGE Failed to execute runnable (java.lang.StackOverflowError) !STACK 0 org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.StackOverflowError) at org.eclipse.swt.SWT.error(SWT.java:2691) at org.eclipse.swt.SWT.error(SWT.java:2616) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:109) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2749) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2434) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.basicRun(Main.java:183) at org.eclipse.core.launcher.Main.run(Main.java:644) at org.eclipse.core.launcher.Main.main(Main.java:628) !ENTRY org.eclipse.ui 4 4 Jul 21, 2004 13:15:17.156 !MESSAGE *** SWT nested exception !ENTRY org.eclipse.ui 4 0 Jul 21, 2004 13:15:17.156 !MESSAGE java.lang.StackOverflowError !STACK 0 java.lang.StackOverflowError !ENTRY org.eclipse.ui 4 4 Jul 21, 2004 13:18:10.515 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 Jul 21, 2004 13:18:10.531 !MESSAGE java.lang.StackOverflowError !STACK 0 java.lang.StackOverflowError
-Which build? -Did you install additional plug-ins? -Is this repeatable? -Are there other errors in .log? -You say a stack overflow happened the second time - what happened the first time? -Dialog? Anything in .log? -What kind of file did you try to open? Can you attach the file?
I would also ask which VM and if there's any special VM arguments specified that might effect stack size? I know I routinely open 300K java files (as part of a test suite) and I've never seen this. So, unlikely to be just file size. I'm sure there's something there, and would be nice to know what ... could it be related to number of warnings (or annotations) in file?
Created attachment 13508 [details] The file that caused the the stack overflow
- I try to open the file: Dialog: Cannot open default editor on FrTest.java. Editor could not be initialized. - I try second time: Dialog: A stack overflow error has occured. ... Do you want to exit the workbench? - Here are the corresponding .log entries: !SESSION Jul 22, 2004 07:46:25.78 ---------------------------------------------- eclipse.buildId=I200406251208 java.version=1.4.2_04 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE !ENTRY org.eclipse.core.runtime 4 2 Jul 22, 2004 08:01:46.671 !MESSAGE An internal error occurred during: "Launching". !STACK 0 java.lang.StackOverflowError !ENTRY org.eclipse.ui 4 4 Jul 22, 2004 08:08:10.359 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 Jul 22, 2004 08:08:10.359 !MESSAGE java.lang.StackOverflowError !STACK 0 java.lang.StackOverflowError - plugins: exmples, CDT, EMF-SDO-XSD - the bug is repeatable with the attached FrTest.java file - I start eclipse with: C:\eclipse\eclipse.exe -vmargs -Djava.endorsed.dirs=C:\java\xalan-j_2_6_0\bin\ - There are no warnings in file
Created attachment 13509 [details] The superclass of FrTest.java
Created attachment 13510 [details] A needed class for FrTest.java
The log entries you attached seem to be only parts. Please attach the whole .log file (zip if too large). Also, the following entry rather looks like you launched and not opened the editor: !ENTRY org.eclipse.core.runtime 4 2 Jul 22, 2004 08:01:46.671 !MESSAGE An internal error occurred during: "Launching". !STACK 0 java.lang.StackOverflowError How do you open the editor exactly? Is the file part of a Java project?
I dubble click on the file in the package explorer. The file is part of Java project in the default package.
Created attachment 13511 [details] The whole log
Sorry, I don't have rar installed. Can you use simple zip or attach it uncompressed. Thanks. Another thing: can you try 1) open the file using Open With > "Java Editor" 2) try with a fresh Eclipse SDK?
Created attachment 13512 [details] The whole log zipped
open the file using Open With > "Java Editor" >>> the same behaviour
Too me the log looks like all the stackoverflows come from Debug when you try to launch. >at org.eclipse.debug.ui.actions.OpenLaunchDialogAction.run(OpenLaunchDialogAction.java:80) I also found errros caused by XMLBuddy but in comment 4 you only wrote: - plugins: exmples, CDT, EMF-SDO-XSD How is that possible? Does it really fail when you simply open that file? Can you clear the .log and simply open that file? Also, please try with a fresh install.
Created attachment 13513 [details] Whole log of a fresh install
I have removed XMLbuddy and the behaviour was the same. I have tried with fresh build (see new log) The bahaviour ist the same.
OK. I think I got it. You launch with default VM args i.e. don't give Eclipse enough memory to hanlde this large file. Try eclipse.exe -vmargs -Xmx200M -Djava.endorsed.dirs=C:\java\xalan-j_2_6_0\bin\
I start with -Xmx200M 1. Eclipse don't want to start because FrTest.java was editing in last session. So I must delete the file. 2. Open with -> Java Editor is OK! 3. Open with dubble click on the file -> old error
ok - a bit better now ;-) Go to the preferences and check what's the default editor for *.java files.
There is no default editor associated with *.java files, but on dubble click in the windows explorer the usual notepad is opened
reference to comment #7: I cannot also launch the application with FrTest.java
In comment 18 I meant which one is associated in Eclipse: Window > Preferences > Workbench > File Associtations
the default editor is Java Editor
Can reproduce the problem with the attached files.
Can be reproduced using SDK 1.4.2_03 (build 1.4.2_03-b02) but not using IBM J2SC (with or without -XJ9 flag). Works if running in interpreted mode (-Xint). ==> JIT bug in VM. Here's where the stack overflow happens: BinaryExpression.resolveType(BlockScope scope) { boolean leftIsCast, rightIsCast; if ((leftIsCast = left instanceof CastExpression) == true) left.bits |= IgnoreNeedForCastCheckMASK; // will check later on TypeBinding leftType = left.resolveType(scope); ^^^^^^^^^^^
Correction to last comment: it also does not work when using: build 1.4.2, J2RE 1.4.2 IBM Windows 32 build cndev-20040524 (JIT enabled: jitc) without -Xj9. Works if JIT is disabled or -Xj9 is used.
David - can you still reproduce ?
I can reproduce the bug in I20050405-0800
The problem come from the resolution of an AST that represent a concatenation of more than 2800 String.
The problem is that the string concatenation has not been optimized in the compiler's tree in order to produce all the string literals for the DOM/AST. The resulting issue is that the compiler cannot resolve the tree because of the StackOverFlowError.
The only way I can see to fix it is to optimize the string literals during the DOM/AST parsing and reparse the whole string literal to get the proper positions.
In fact on this specific source, even if I use the optimizeStringLiteral support from the compiler it won't work. The problem comes from the fact that the huge string concatenation starts with a method invocation and then it is not optimized. So the problem is really in the compiler that cannot compile this file. javac 1.5 also fails with a StackOverFlowError.
Philippe, This might require the addition of a new node in the compiler. Jikes can successfully compile it. It is the only java compiler that successfully compiles this code.
If the code is simply using a huge string concatenation, the conversion works fine. Add regression test in org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2.test0602.
not for 3.1
What about 3.3 ;-)
reopening
Olivier - is this still an issue ?
If this is still an issue, please investigate for 3.4. Otherwise please close.
Could not reproduce the failure using 3.3RC4. Closing as WORKSFORME. Please reopen if you get it again.