Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 206697

Summary: [compiler] Crash when opening a specific Java file in the editor
Product: [Eclipse Project] JDT Reporter: Asgeir Frimannsson <asgeirf>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: elharo, jerome_lanneluc, Olivier_Thomann, remy.suen
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug
Attachments:
Description Flags
Sourcefile that causes crash... none

Description Asgeir Frimannsson CLA 2007-10-17 18:45:23 EDT
Created attachment 80620 [details]
Sourcefile that causes crash...

Build ID: I20070621-1340

Steps To Reproduce:
1. Open or paste the java source from http://fisheye5.cenqua.com/browse/~raw,r=1.5/xom/src/nu/xom/UnicodeUtil.java 
2. Pop up error message 'An internal error occurred during 'Requesting java AST from selection'
3. ..followed by an 'Internal Error occurred while showing an internal error'


More information:
Using standard Eclipse Europa on Linux x86 (Fedora 7).
Comment 1 Elliotte Rusty Harold CLA 2007-10-18 06:16:33 EDT
This sounds like a duplicate of https://bugs.eclipse.org/bugs/show_bug.cgi?id=154047 However this time the problem occurs on Linux rather than Mac OS X.
Comment 2 Jerome Lanneluc CLA 2007-10-18 06:52:33 EDT
The 'crash' is in fact a StackOverflowError:

java.lang.StackOverflowError
        at org.eclipse.jdt.internal.compiler.parser.Scanner.getNextToken(Scanner.java:1660)
        at org.eclipse.jdt.core.dom.ASTConverter.retrieveEndOfElementTypeNamePosition(ASTConverter.java:4053)
        at org.eclipse.jdt.core.dom.ASTConverter.convertType(ASTConverter.java:3086)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1172)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1529)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1999)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1620)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2478)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1130)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2382)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1784)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2406)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1789)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2406)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1789)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2406)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1789)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2406)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1789)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2406)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1789)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2406)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1789)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2406)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1789)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2406)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1789)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2406)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1789)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2406)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1789)
        at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2406)
Comment 3 Jerome Lanneluc CLA 2007-10-18 06:54:54 EDT
This is not a dup of bug 154047 (since the StackOverflow happens in another part of the code). However the workaround described in this bug will work (ie. increasing the stack size will allow this test case to pass).

To fix this, the ASTConverter would need to be rewritten to not use recursion. That is not an obvious change.
Comment 4 Olivier Thomann CLA 2007-10-19 22:51:41 EDT
What VM are you running on?
What is the stack size ?
Comment 5 Asgeir Frimannsson CLA 2007-10-19 23:21:48 EDT
(In reply to comment #4)
> What VM are you running on?
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

> What is the stack size ?
eclipse.ini: (standard 3.3.0 unchanged...)
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
128M
-vmargs
-Xms40m
-Xmx256m
-Dosgi.bundlefile.limit=100

Adding e.g an -Xss2m parameter does indeed 'solve' this issue. However, there should really be a more friendly way of reporting errors with (and configuring) memory usage within Eclipse...
Comment 6 Eclipse Genie CLA 2020-05-08 13:37:30 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.