| Summary: | [parser] StackOverFlowError in erroneous jsp file - destabilizing issue | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP Source Editing | Reporter: | Patric Rufflar <patric> | ||||||||
| Component: | jst.jsp | Assignee: | Nick Sandonato <nsand.dev> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | Nick Sandonato <nsand.dev> | ||||||||
| Severity: | major | ||||||||||
| Priority: | P3 | CC: | nsand.dev, thatnitind | ||||||||
| Version: | unspecified | ||||||||||
| Target Milestone: | 3.4.2 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Patric Rufflar
Created attachment 194732 [details]
file which will reproduce the bug
Just open this file within WTP.
As a fringe case, looking like a fuzz test similar to the others that you recently opened, we're going to take down the severity. This doesn't seem like a frequent enough scenario to warrant critical. Created attachment 194767 [details]
patch
The problem with the stack was that it wasn't resizable. It was assumed that by the time we got to a state stack of 100, the document was already beyond repair. I guess this test file fits right in line with that assumption ;)
Thanks for the sample file, Patric. Created attachment 194776 [details]
patch for styles
Even with the patch to correct the IntStack, the style ranges generated were off in places. Looking into it, I realized we could definitely do with some bullet proofing to the PresentationCollector to avoid being unable to open an editor for some of these invalid styles. For example, I was seeing negative length text regions. I believe a bug you opened before, Patric, ended up with negative length text regions as well.
Nick, please note that I am using the fuzz tests only to be able to provide you a way to reproduce the bug. Every bug report which I opened has been seen in "real life" from my colleagues or myself. During my fuzz tests I saw even more errors which I didn't post (yet). At 214097, there's a bit <%--%> that seems to cause all the problems in terms of overlapping style regions. Cleanup the <%-- and no more syntax highlighting problems. This particular bit seems to be causing a negative text region length. Checked in changes to the IntStack as well as the PresentationCollector.Still investigating why we're getting negative lengths. It seems like yy_markedPos is sometimes ending up behind yy_startRead when we invoke yylength() in getNextToken() (In reply to comment #8) > Checked in changes to the IntStack as well as the PresentationCollector.Still > investigating why we're getting negative lengths. > > It seems like yy_markedPos is sometimes ending up behind yy_startRead when we > invoke yylength() in getNextToken() It could be that the manipulation going on in #doScan() doesn't properly guard against cases where the start region contents overlap with the searchString. Final bits pushed today to correct the overlapping ranges. http://git.eclipse.org/c/sourceediting/webtools.sourceediting.git/commit/?id=19ef5ca9119489b5952b6c152aa1b0964f2448be |