chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Hübel (JIRA) <j...@apache.org>
Subject [jira] [Commented] (CMIS-1051) OOM when parsing string with double quotes
Date Fri, 17 Nov 2017 17:01:00 GMT

    [ https://issues.apache.org/jira/browse/CMIS-1051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16257218#comment-16257218
] 

Jens Hübel commented on CMIS-1051:
----------------------------------

The problem is somehow in the lexer generator. The Java class generated from AntLR with Java7
is different to the one from Java9:

public class CmisQlStrictLexer_CmisBaseLexer extends Lexer {
...
static final String DFA12_minS =
		"\1\11\1\103\1\101\1\116\1\117\2\116\1\105\1\111\1\110\1\131\1\105\2\117"+
	...
}

Java 9:
public class CmisQlStrictLexer_CmisBaseLexer extends Lexer {
...
static final String DFA12_minS =
		"\1\47\1\103\1\101\1\116\1\117\2\116\1\105\1\111\1\110\1\131\1\105\2\117"+
...
}

One starts with 1, 47 the other one with 1, 11
In the debugger I see a tab character in the string (correct) and in the other case a single
quote (wrong).
This breaks the parsing. If someone has a clue what Java 9 feature may cause this please comment.


> OOM when parsing string with double quotes
> ------------------------------------------
>
>                 Key: CMIS-1051
>                 URL: https://issues.apache.org/jira/browse/CMIS-1051
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-server
>    Affects Versions: OpenCMIS 1.1.0
>            Reporter: Michael Brackx
>            Assignee: Jens Hübel
>
> parsing a query with an incorrect string literal using double quotes (") iso of single
quotes (') leads to an OOM exception
> example query:
> {noformat}
> SELECT * FROM cmis:document WHERE cmis:name = "a"
> {noformat}
> testcase for TestParserStrict
> {noformat}
>     @Test
>     public void queryDoubleQuotes() throws Exception {
>         testParserFail("query", "SELECT * FROM cmis:document WHERE cmis:name = \"a\"");
>     }
> {noformat}
> stacktrace:
> {noformat}
> java.lang.OutOfMemoryError: Java heap space
> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
> 	at org.apache.chemistry.opencmis.server.support.query.AbstractParserTest.execParser(AbstractParserTest.java:188)
> 	at org.apache.chemistry.opencmis.server.support.query.AbstractParserTest.testParserFail(AbstractParserTest.java:95)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message