lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Kudryavtsev (JIRA)" <>
Subject [jira] [Commented] (SOLR-11512) Query parsing should not loop forever with 100% cpu
Date Thu, 19 Oct 2017 12:40:00 GMT


Andrey Kudryavtsev commented on SOLR-11512:

I believe it will end up with  "Infinite Recursion detected parsing query ...", but it will
take ages. 

I checked it by decreasing value for {{recurseCount}} condition in 

  private void checkRecurse() throws SyntaxError {
    if (recurseCount++ >= 100) {

Does it make sense to parse boost parameters for boost query? Fast patch to avoid it is attached.

> Query parsing should not loop forever with 100% cpu
> ---------------------------------------------------
>                 Key: SOLR-11512
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: 7.1
>            Reporter: Will Currie
>            Priority: Minor
>         Attachments: SOLR-11512.patch
> The following query against the techproducts example puts solr into an infinite loop:
> {noformat}
> curl -g -v 'http://localhost:8983/solr/techproducts/select?q=*&defType=edismax&qq={!edismax+v=something}&bq={!edismax+v=$qq}
> {noformat}
> Problem doesn't depend on the collection, just an easy example. I guess I'd expect a
failure with "Infinite Recursion detected parsing query ..." instead. So depending on the
query config a user typing {!edismax v=whatever} into a search box can send a solr instance
to 100% cpu.
> I can reproduce using TestExtendedDismaxParser by adding:
> {code}
>   @Test
>   public void loopsForever() throws Exception {
>     assertJQ(req("defType", "edismax", "q", "*", "qq", "{!edismax v=something}", "bq",
"{!edismax v=$qq}"));
>   }
> {code}
> The code seems to hit QParser.checkRecurse() and try to fail but something sends it around
for another try. Repeat.
> Given the complexity of the parsing code there may well be other examples. There's no
way to disable the local params syntax is there? Question was asked in SOLR-4197.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message