Bug 118105 - [javadoc][assist] Hang with 100% CPU during code assist on comment
Summary: [javadoc][assist] Hang with 100% CPU during code assist on comment
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows 2000
: P3 critical (vote)
Target Milestone: 3.2 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-25 15:55 EST by John Arthorne CLA
Modified: 2005-12-13 09:36 EST (History)
0 users

See Also:


Attachments
ZIP file containing three stack traces (446.43 KB, application/octet-stream)
2005-11-25 15:56 EST, John Arthorne CLA
no flags Details
Patch to fix this issue (3.92 KB, patch)
2005-11-27 10:32 EST, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2005-11-25 15:55:09 EST
Build id: I20051123-1200

I performed content assist (Ctrl+Space) on a javadoc comment, and my machine froze with 100% CPU used by the java process.  I left my machine for five minutes and it was in the same state when I returned.  I will attach stack traces from the beginning and the end of that five minutes.

I don't have reproducible steps, and I lost the code in which the error occurred because I was forced to kill the VM. However, I was performing completion on something like this: 

/**
 * Some words here {@link IRes<cursor>
 */

I.e., I wanted to complete "IResource" in the link, and then it froze.
Comment 1 John Arthorne CLA 2005-11-25 15:56:42 EST
Created attachment 30641 [details]
ZIP file containing three stack traces
Comment 2 John Arthorne CLA 2005-11-25 15:58:34 EST
For convenience, here is the top of the stack in all these stack dumps:

"main" (TID:0x00119700, sys_thread_t:0x00235B14, state:CW, native ID:0x000003CC) prio=6
at org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.commentParse(AbstractCommentParser.java:152)
at org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.commentParse(CompletionJavadocParser.java:89)
at org/eclipse/jdt/internal/compiler/parser/JavadocParser.checkDeprecation(JavadocParser.java:75)
at org/eclipse/jdt/internal/codeassist/complete/CompletionJavadocParser.checkDeprecation(CompletionJavadocParser.java:77)
at org/eclipse/jdt/internal/compiler/parser/Parser.checkComment(Parser.java:890)
at org/eclipse/jdt/internal/compiler/parser/Parser.consumeModifiers(Parser.java:4155)
at org/eclipse/jdt/internal/codeassist/complete/CompletionParser.consumeModifiers(CompletionParser.java:2347)
at org/eclipse/jdt/internal/compiler/parser/Parser.consumeRule(Parser.java:5589)
at org/eclipse/jdt/internal/compiler/parser/Parser.parse(Parser.java:8528)
at org/eclipse/jdt/internal/compiler/parser/Parser.parse(Parser.java:8698)
at org/eclipse/jdt/internal/compiler/parser/Parser.parse(Parser.java:8663)
at org/eclipse/jdt/internal/compiler/parser/Parser.dietParse(Parser.java:7453)
at org/eclipse/jdt/internal/codeassist/complete/CompletionParser.dietParse(CompletionParser.java:3283)
at org/eclipse/jdt/internal/codeassist/CompletionEngine.complete(CompletionEngine.java:1594)
at org/eclipse/jdt/internal/core/Openable.codeComplete(Openable.java:125)
at org/eclipse/jdt/internal/core/CompilationUnit.codeComplete(CompilationUnit.java:322)
at org/eclipse/jdt/internal/core/CompilationUnit.codeComplete(CompilationUnit.java:315)
Comment 3 Olivier Thomann CLA 2005-11-25 16:01:06 EST
This looks like an infinite loop in the AbstractCommentParser. line152 is the condition of a while statement.
Comment 4 Frederic Fusier CLA 2005-11-27 09:41:24 EST
John,
Unfortunately, I cannot reproduce your problem with the simple test you provide.
Is there anything else you can remember when this happened? What was the source you were editing, what were your compiler/content assist options, etc.?
Can you try to reproduce and give a more precise scenario to help me to find the origin of the problem?
TIA
Comment 5 Frederic Fusier CLA 2005-11-27 10:00:59 EST
I finally got it. Here's the test case:
/**
 * Some words here {@link IRes<cursor>.
 */
class Test {}

The important point is the '.' after cursor location...
Comment 6 Frederic Fusier CLA 2005-11-27 10:32:55 EST
Created attachment 30675 [details]
Patch to fix this issue

Specific Eclipse patch format, includes 2 projects:
  - org.eclipse.jdt.core
  - org.eclipse.jdt.core.tests.model
Comment 7 Frederic Fusier CLA 2005-11-27 12:19:21 EST
Patch released in HEAD.

Test case added in JavadocBugsCompletionModelTest
Comment 8 Jerome Lanneluc CLA 2005-12-13 09:36:45 EST
Verified for 3.2 M4 using build I20051213-0010