You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Mark Miller (JIRA)" <ji...@apache.org> on 2008/08/21 13:56:44 UTC

[jira] Commented: (LUCENE-504) FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount

    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624345#action_12624345 ] 

Mark Miller commented on LUCENE-504:
------------------------------------

This really should be fixed. I agree with Nadav, the problem is with the Queries that use MaxClauses to build the priority queue - its just not good use of the queue.

I also agree with Doron that its really two distinct issues though:

1. FuzzyQuery et al should be using lazy allocation of some kind. It makes no sense to create an array that large for every multi term query, especially when we direct users to possibly use Integer.MAX_VALUE.

2.  The FAQ should not say to use Integer.MAX_VALUE if its going to kak with FuzzyQuery. At a minimum, FuzzyQuery should not init the priority queue larger than Integer.MAX_VALUE-1.

I suppose, that almost combines the 2 issues though - we are telling users to set the max clauses to a number that will force ridiculously wasteful memory allocation. Almost seems like both issues really need to be addressed together. Or maybe just the FAQ changed :)

> FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-504
>                 URL: https://issues.apache.org/jira/browse/LUCENE-504
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 1.9
>            Reporter: Joerg Henss
>            Priority: Minor
>         Attachments: BooleanQuery.java.diff, fuzzyquery.patch, PriorityQueue.java.diff, TestFuzzyQueryError.java
>
>
> PriorityQueue creates an "java.lang.NegativeArraySizeException" when initialized with Integer.MAX_VALUE, because Integer overflows. I think this could be a general problem with PriorityQueue. The Error occured when I set BooleanQuery.MaxClauseCount to Integer.MAX_VALUE and user a FuzzyQuery for searching.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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