Community
Participate
Working Groups
The first time I do a "Content Assist" in a workspace after startup (With Other Java, Template, and Type specified), I get this StackOverflowException. After ignoring the error, subsequent content assists work fine. I can't get to the start of the stack trace, unfortunately, but I can reproduce this at will in our very large project. Eclipse is running with -Xss256k. !SESSION 2008-08-10 12:17:43.859 ----------------------------------------------- eclipse.buildId=I20080617-2000 java.version=1.5.0_15 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86_64 !ENTRY org.eclipse.ui 2 0 2008-08-10 12:17:47.595 !MESSAGE Warnings while parsing the key bindings from the 'org.eclipse.ui.commands' extension point !SUBENTRY 1 org.eclipse.ui 2 0 2008-08-10 12:17:47.595 !ENTRY org.eclipse.ui 4 0 2008-08-10 12:18:14.384 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.StackOverflowError at java.util.regex.Pattern$Loop.match(Pattern.java:4685) at java.util.regex.Pattern$GroupTail.match(Pattern.java:4637) at java.util.regex.Pattern$GroupTail.match(Pattern.java:4637) at java.util.regex.Pattern$BitClass.match(Pattern.java:2876) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4578) at java.util.regex.Pattern$Branch.match(Pattern.java:4538) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4578) at java.util.regex.Pattern$Loop.match(Pattern.java:4705) at java.util.regex.Pattern$GroupTail.match(Pattern.java:4637) at java.util.regex.Pattern$GroupTail.match(Pattern.java:4637) at java.util.regex.Pattern$BitClass.match(Pattern.java:2876) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4578) at java.util.regex.Pattern$Branch.match(Pattern.java:4538) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4578) at java.util.regex.Pattern$Loop.match(Pattern.java:4705) at java.util.regex.Pattern$GroupTail.match(Pattern.java:4637) at java.util.regex.Pattern$GroupTail.match(Pattern.java:4637) at java.util.regex.Pattern$BitClass.match(Pattern.java:2876) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4578) at java.util.regex.Pattern$Branch.match(Pattern.java:4538) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4578) at java.util.regex.Pattern$Loop.match(Pattern.java:4705) at java.util.regex.Pattern$GroupTail.match(Pattern.java:4637) at java.util.regex.Pattern$GroupTail.match(Pattern.java:4637) at java.util.regex.Pattern$BitClass.match(Pattern.java:2876) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4578) at java.util.regex.Pattern$Branch.match(Pattern.java:4538) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4578) at java.util.regex.Pattern$Loop.match(Pattern.java:4705) at java.util.regex.Pattern$GroupTail.match(Pattern.java:46370 ... (about 1000 lines) at java.util.regex.Pattern$BitClass.match(Pattern.java:2876) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4578) at java.util.regex.Pattern$Branch.match(Pattern.java:4538) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4578)
Steps to reproduce are required for further investigation.
Meh. My eclipse.ini unfortunately turned down the stack size to -Xss256k. When I set it back to 512k, it was fine. However, I didn't hit it anywhere else in eclipse after a month. The java implementation of regex often goes off the stack deepend, but feel free to punt. 1. It only applies if "Template" proposal is enabled in content assist. 2. Here's the base of the stacktrace where it dies, I couldn't find the template that was failing however. Pattern$Branch.match(Matcher, int, CharSequence) line: 4538 Pattern$Branch.match(Matcher, int, CharSequence) line: 4538 Pattern$Start.match(Matcher, int, CharSequence) line: 3019 Matcher.search(int) line: 1092 Matcher.find() line: 528 TemplateTranslator.parse(String) line: 167 TemplateTranslator.translate(String) line: 149 JavaContextType(TemplateContextType).validate(String) line: 200 ContributionTemplateStore.validateTemplate(Template) line: 194 ContributionTemplateStore.readIncludedTemplates(Collection, IConfigurationElement) line: 156 ContributionTemplateStore.readContributedTemplates(IConfigurationElement[]) line: 120 ContributionTemplateStore.loadContributedTemplates() line: 107 ContributionTemplateStore(TemplateStore).load() line: 108 JavaPlugin.getTemplateStore() line: 849 TemplateEngine.complete(ITextViewer, int, ICompilationUnit) line: 124 TemplateCompletionProposalComputer(AbstractTemplateCompletionProposalComputer).computeCompletionProposals(ContentAssistInvocationContext, IProgressMonitor) line: 63 CompletionProposalComputerDescriptor.computeCompletionProposals(ContentAssistInvocationContext, IProgressMonitor) line: 316 CompletionProposalCategory.computeCompletionProposals(ContentAssistInvocationContext, String, SubProgressMonitor) line: 264 JavaCompletionProcessor(ContentAssistProcessor).collectProposals(ITextViewer, int, IProgressMonitor, ContentAssistInvocationContext) line: 285 JavaCompletionProcessor(ContentAssistProcessor).computeCompletionProposals(ITextViewer, int) line: 245 ContentAssistant.computeCompletionProposals(ITextViewer, int) line: 1836 CompletionProposalPopup.computeProposals(int) line: 553 CompletionProposalPopup.access$16(CompletionProposalPopup, int) line: 550 CompletionProposalPopup$2.run() line: 485 BusyIndicator.showWhile(Display, Runnable) line: 70 CompletionProposalPopup.showProposals(boolean) line: 479 ContentAssistant.showPossibleCompletions() line: 1664 CompilationUnitEditor$AdaptedSourceViewer.doOperation(int) line: 177 ContentAssistAction$1.run() line: 82 BusyIndicator.showWhile(Display, Runnable) line: 70 ContentAssistAction.run() line: 80 ContentAssistAction(Action).runWithEvent(Event) line: 498 ActionHandler.execute(Map) line: 185 LegacyHandlerWrapper.execute(ExecutionEvent) line: 109 Command.executeWithChecks(ExecutionEvent) line: 476 ParameterizedCommand.executeWithChecks(Object, Object) line: 508 HandlerService.executeCommand(ParameterizedCommand, Event) line: 169 ...
Template proposals are computed by JDTText.
That's not our bug, see: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507 A test case would help. Maybe we can do something to avoid the exception. Please reopen if you have steps to reproduce this problem.
See also bug 240259. With -Xss128K, I ran into a StackOverflowError while parsing the "org.eclipse.jdt.ui.text.codetemplates.swt.datetime" template. The stack for matching the TemplateTranslator.ESCAPE_PATTERN was really a bit high. Fixed in HEAD of TemplateTranslator by adding a few possessives to the regexes to avoid backtracking (e.g. '*+' instead of '*').
*** Bug 240259 has been marked as a duplicate of this bug. ***
Verified in I20080918-0100.