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

Bug 529703

Summary: Incorrect HTML-like-label highlighting causes Eclipse to hang
Product: [Tools] GEF Reporter: Zoey Gerrit Prigge <eclipse>
Component: GEF DOTAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: miklossy
Version: unspecified   
Target Milestone: 5.0.100 (Photon) M6   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Zoey Gerrit Prigge CLA 2018-01-12 02:50:33 EST
If a an invalid HTML-like label is preceding a path in the dot-File, Eclipse hangs during Syntax Highlighting (infinite loop).

Brief analysis has shown:
In XTextTokenStream.fillBuffer() a buffer seems to be filled with an unlimited number of ErrorToken.

Further, the HTML-like label lexer is passed not only the HTML-like label itself, but also the remaining contents of the dot-File following the label.

For reference, this dot-file content should allow to reproduce the situation.

digraph structs {
    node [shape=plaintext]
    struct [label=<
    	<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" bgcolor="blue">
            <TR><TD><fonttext2</font></TD></TR>         
        </TABLE>>];
    // need something after this to cause error
    struct:w -> struct:e;
}
Comment 1 Tamas Miklossy CLA 2018-02-19 17:59:10 EST
I pushed the following changes to origin/master:

[529703] Avoid blocking UI while editing an incomplete Dot Html-Label.

- Modify the Dot Html-Like Label custom lexers to accept the TAG_START
and the TAG_START_CLOSE tokens also in 'tagMode' to avoid that the
lexers go into infinite loop.
- Implement corresponding test cases.

Resolving as fixed in 5.0.100 (Photon) M6.