You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jeff Huang (JIRA)" <ji...@apache.org> on 2013/10/16 04:09:42 UTC

[jira] [Created] (LUCENE-5286) data races in org.apache.lucene.queryParser.QueryParserTokenManager

Jeff Huang created LUCENE-5286:
----------------------------------

             Summary: data races in org.apache.lucene.queryParser.QueryParserTokenManager
                 Key: LUCENE-5286
                 URL: https://issues.apache.org/jira/browse/LUCENE-5286
             Project: Lucene - Core
          Issue Type: Bug
          Components: core/queryparser
    Affects Versions: 3.6.2
            Reporter: Jeff Huang


Hi, 

We ran a dynamic detector on Lucene and found quite a number of races in org.apache.lucene.queryParser.QueryParserTokenManager when an instance of this class is shared by multiple threads. Almost all field variables of this class are racey, e.g., curChar, curLexState jjnewStateCnt jjmatchedPos jjmatchedKind. 

For example, methods "jjMoveStringLiteralDfa0_3" and "getNextToken" can be executed by different threads at the same time with no synchronization. The read and write to "curChar" at lines 65 and 1174 may corrupt the parser.

63  private int More jjMoveStringLiteralDfa0_3()
64  {
65     switch(curChar)
66     {


1164public Token More getNextToken() 
1165{
1166  Token matchedToken;
1167  int curPos = 0;
1168
1169  EOFLoop :
1170  for (;;)
1171  {
1172   try
1173   {
1174      curChar = input_stream.BeginToken();
1175   }





--
This message was sent by Atlassian JIRA
(v6.1#6144)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org