Grokbase Groups Lucene dev March 2006
FAQ
FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
--------------------------------------------------------------------------------------------------------------------------------------------------

Key: LUCENE-504
URL: http://issues.apache.org/jira/browse/LUCENE-504
Project: Lucene - Java
Type: Bug
Components: Search
Versions: 1.9
Reporter: Joerg Henss
Priority: Minor


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.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira


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

Search Discussions

  • Joerg Henss (JIRA) at Mar 1, 2006 at 5:59 pm
    [ http://issues.apache.org/jira/browse/LUCENE-504?page=all ]

    Joerg Henss updated LUCENE-504:
    -------------------------------

    Attachment: TestFuzzyQueryError.java

    Simple test showing the error
    FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
    --------------------------------------------------------------------------------------------------------------------------------------------------

    Key: LUCENE-504
    URL: http://issues.apache.org/jira/browse/LUCENE-504
    Project: Lucene - Java
    Type: Bug
    Components: Search
    Versions: 1.9
    Reporter: Joerg Henss
    Priority: Minor
    Attachments: 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.
    -
    If you think it was sent incorrectly contact one of the administrators:
    http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see:
    http://www.atlassian.com/software/jira


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Paul Borgermans (JIRA) at Jun 2, 2006 at 3:14 pm
    [ http://issues.apache.org/jira/browse/LUCENE-504?page=comments#action_12414438 ]

    Paul Borgermans commented on LUCENE-504:
    ----------------------------------------

    Here the same problem, used a MultiFieldQueryParser in combination with fuzzy search which triggered the exception
    FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
    --------------------------------------------------------------------------------------------------------------------------------------------------

    Key: LUCENE-504
    URL: http://issues.apache.org/jira/browse/LUCENE-504
    Project: Lucene - Java
    Type: Bug
    Components: Search
    Versions: 1.9
    Reporter: Joerg Henss
    Priority: Minor
    Attachments: 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.
    -
    If you think it was sent incorrectly contact one of the administrators:
    http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see:
    http://www.atlassian.com/software/jira


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Doron Cohen (JIRA) at Jun 12, 2006 at 2:09 am
    [ http://issues.apache.org/jira/browse/LUCENE-504?page=comments#action_12415800 ]

    Doron Cohen commented on LUCENE-504:
    ------------------------------------

    LuceneFAQ item "Why am I getting a TooManyClauses exception?"
    suggests: "use BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE)".

    This would cause PriorityQueue to create an array of size maxint:
    - SUN JRE throws an out-of-memory error.
    - IBM JRE throws a "too large allocation" runtime error.

    Seems that at least two fixes are required:
    + BooleanQuery - hard limit on value of maxClauseCount
    + PriorityQueue - hard limit on size of queue, since it is stored in memory.

    The attached would set 1,000,000 hard limit - defined in PriorityQueu - I think the most intensive use of
    priority queue is for docs/hits during search, and 1M docs seems sufficient, unless there are uses that I am not aware of.

    FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
    --------------------------------------------------------------------------------------------------------------------------------------------------

    Key: LUCENE-504
    URL: http://issues.apache.org/jira/browse/LUCENE-504
    Project: Lucene - Java
    Type: Bug
    Components: Search
    Versions: 1.9
    Reporter: Joerg Henss
    Priority: Minor
    Attachments: 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.
    -
    If you think it was sent incorrectly contact one of the administrators:
    http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see:
    http://www.atlassian.com/software/jira


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Doron Cohen (JIRA) at Jun 12, 2006 at 2:11 am
    [ http://issues.apache.org/jira/browse/LUCENE-504?page=all ]

    Doron Cohen updated LUCENE-504:
    -------------------------------

    Attachment: BooleanQuery.java.diff
    PriorityQueue.java.diff
    FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
    --------------------------------------------------------------------------------------------------------------------------------------------------

    Key: LUCENE-504
    URL: http://issues.apache.org/jira/browse/LUCENE-504
    Project: Lucene - Java
    Type: Bug
    Components: Search
    Versions: 1.9
    Reporter: Joerg Henss
    Priority: Minor
    Attachments: BooleanQuery.java.diff, 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.
    -
    If you think it was sent incorrectly contact one of the administrators:
    http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see:
    http://www.atlassian.com/software/jira


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Otis Gospodnetic (JIRA) at Jun 12, 2006 at 3:31 am
    [ http://issues.apache.org/jira/browse/LUCENE-504?page=comments#action_12415807 ]

    Otis Gospodnetic commented on LUCENE-504:
    -----------------------------------------

    I imagine the limit will depend on how big of a heap you allow, no? What happens if you increase the heap size drammatically with -XmxNNNm?

    FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
    --------------------------------------------------------------------------------------------------------------------------------------------------

    Key: LUCENE-504
    URL: http://issues.apache.org/jira/browse/LUCENE-504
    Project: Lucene - Java
    Type: Bug
    Components: Search
    Versions: 1.9
    Reporter: Joerg Henss
    Priority: Minor
    Attachments: BooleanQuery.java.diff, 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.
    -
    If you think it was sent incorrectly contact one of the administrators:
    http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see:
    http://www.atlassian.com/software/jira


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Doron Cohen (JIRA) at Jun 12, 2006 at 7:29 am
    [ http://issues.apache.org/jira/browse/LUCENE-504?page=comments#action_12415825 ]

    Doron Cohen commented on LUCENE-504:
    ------------------------------------

    Yes this is correct - e.g. on a win32 machine with 2GB RAM, SUN 1.5 JRE would accept up to Xmx1470m and in that case you could set the limit on the queue size to 355,638,512 - 17% of maxint, before getting an out of mem error.

    For allowing the caller maximal flexibility (and responsibility), BooleanQuery could interpret the maxint as a hint saying "maximal possible value" and then silently modify it to maxint-1, thereby avoiding the negative array size issue in PriorityQueue (and possibly fail later with out of memory).

    Is this what you have in mind?
    FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
    --------------------------------------------------------------------------------------------------------------------------------------------------

    Key: LUCENE-504
    URL: http://issues.apache.org/jira/browse/LUCENE-504
    Project: Lucene - Java
    Type: Bug
    Components: Search
    Versions: 1.9
    Reporter: Joerg Henss
    Priority: Minor
    Attachments: BooleanQuery.java.diff, 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.
    -
    If you think it was sent incorrectly contact one of the administrators:
    http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see:
    http://www.atlassian.com/software/jira


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Nadav Har'El (JIRA) at Jun 14, 2006 at 10:47 am
    [ http://issues.apache.org/jira/browse/LUCENE-504?page=comments#action_12416168 ]

    Nadav Har'El commented on LUCENE-504:
    -------------------------------------

    Hi Doron and Otis,

    My view is that this bug is a problem in FuzzyQuery, not in PriorityQueue or BooleanQuery. It is the caller's duty to create a priority queue with a sensible size, and it's not BooleanQuery's fault that other classes are using its getMaxClauseCount() wrongly. Moreover, changing PriorityQueue or BooleanQuery in the way Doron did, might potentially have side-effects because they are used in many places in Lucene. How do we know that nowhere in Lucene will we ever need a priority queue with a million elements?

    Therefore I suggest a different patch, changing only FuzzyQuery.

    he idea in the patch I'm attaching is that while FuzzyQuery *is allowed to* create BooleanQuery.getMaxClauseCount() clauses, it doesn't have to do so, and doesn't need to create a priority queue of that size when this number is huge. I added to FuzzyQuery its own maxClauseCount (with per-instance getter/setter methods) and FuzzyQuery will never try to create more than this number of clauses, even if Boolean.getMaxClauseCount() is huge.

    I set FuzzyQuery's default maxClauseCount to 1024, for backward compatibility (this is what happens today when you use BooleanQuery's defaults). However, it is likely that a user will want to set this number much lower than that. In fact, the whole idea of the priority queue is that it may be enough to take only a small number the most similar terms, so setting a FuzzyQuery's maxClauseCount to 100 or even 10 makes sense to me. This new feature is an added benefit of my patch.

    My patch also includes Javadoc changes describing the new feature, and a new test case that failed before the fix, and succeeds after this patch.
    FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
    --------------------------------------------------------------------------------------------------------------------------------------------------

    Key: LUCENE-504
    URL: http://issues.apache.org/jira/browse/LUCENE-504
    Project: Lucene - Java
    Type: Bug
    Components: Search
    Versions: 1.9
    Reporter: Joerg Henss
    Priority: Minor
    Attachments: BooleanQuery.java.diff, 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.
    -
    If you think it was sent incorrectly contact one of the administrators:
    http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see:
    http://www.atlassian.com/software/jira


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Nadav Har'El (JIRA) at Jun 14, 2006 at 10:49 am
    [ http://issues.apache.org/jira/browse/LUCENE-504?page=all ]

    Nadav Har'El updated LUCENE-504:
    --------------------------------

    Attachment: fuzzyquery.patch

    This is my proposed patch described above.
    FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
    --------------------------------------------------------------------------------------------------------------------------------------------------

    Key: LUCENE-504
    URL: http://issues.apache.org/jira/browse/LUCENE-504
    Project: Lucene - Java
    Type: Bug
    Components: Search
    Versions: 1.9
    Reporter: Joerg Henss
    Priority: Minor
    Attachments: BooleanQuery.java.diff, PriorityQueue.java.diff, TestFuzzyQueryError.java, fuzzyquery.patch

    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.
    -
    If you think it was sent incorrectly contact one of the administrators:
    http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see:
    http://www.atlassian.com/software/jira


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Nadav Har'El (JIRA) at Jun 29, 2006 at 11:32 am
    [ http://issues.apache.org/jira/browse/LUCENE-504?page=comments#action_12418446 ]

    Nadav Har'El commented on LUCENE-504:
    -------------------------------------

    Hi Otis, you did not comment on my patch (fuzzyquery.patch), which I think solves your objections to Doron's previous patch. Do you also see problems in this patchl, or would prefer a different approach to solving this issue?
    If not, perhaps you can commit this patch?
    Thanks in advance, Nadav.
    FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
    --------------------------------------------------------------------------------------------------------------------------------------------------

    Key: LUCENE-504
    URL: http://issues.apache.org/jira/browse/LUCENE-504
    Project: Lucene - Java
    Type: Bug
    Components: Search
    Versions: 1.9
    Reporter: Joerg Henss
    Priority: Minor
    Attachments: BooleanQuery.java.diff, PriorityQueue.java.diff, TestFuzzyQueryError.java, fuzzyquery.patch

    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.
    -
    If you think it was sent incorrectly contact one of the administrators:
    http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see:
    http://www.atlassian.com/software/jira


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Doron Cohen (JIRA) at Jul 6, 2006 at 11:51 pm
    [ http://issues.apache.org/jira/browse/LUCENE-504?page=comments#action_12419624 ]

    Doron Cohen commented on LUCENE-504:
    ------------------------------------

    I think it makes sense to separate here between efficiency and correctness.

    The proposed fix above deals with efficiency, and maybe it should become a new separate future issue, perhaps also considering a more lazy allocation of space by PriorityQueue.

    This issue is about correctness - setting max-clause "by-the-book" throws an exception - let's fix just that..

    Modifying PriorityQueue to be tolerant to maxint capacity is one possible solution, though perhaps an overkill.

    A simpler way is for PriorityQueue to silently decrement its maxsize by 1 in case maxsize is requested to be maxint.
    FuzzyQuery produces a "java.lang.NegativeArraySizeException" in PriorityQueue.initialize if I use Integer.MAX_VALUE as BooleanQuery.MaxClauseCount
    --------------------------------------------------------------------------------------------------------------------------------------------------

    Key: LUCENE-504
    URL: http://issues.apache.org/jira/browse/LUCENE-504
    Project: Lucene - Java
    Type: Bug
    Components: Search
    Versions: 1.9
    Reporter: Joerg Henss
    Priority: Minor
    Attachments: BooleanQuery.java.diff, PriorityQueue.java.diff, TestFuzzyQueryError.java, fuzzyquery.patch

    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.
    -
    If you think it was sent incorrectly contact one of the administrators:
    http://issues.apache.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see:
    http://www.atlassian.com/software/jira


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-dev-help@lucene.apache.org
  • Mark Miller (JIRA) at Aug 21, 2008 at 11:57 am
    [ 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
  • George Papas (JIRA) at Dec 17, 2008 at 11:01 pm
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657602#action_12657602 ]

    George Papas commented on LUCENE-504:
    -------------------------------------

    Hi,

    This is still an issue in 2.4.0. I know this is low priority, but has there been any more thinking about how to address this?

    Thanks
    George.
    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
  • Florian Waltersdorfer (JIRA) at Jul 15, 2009 at 11:39 pm
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731744#action_12731744 ]

    Florian Waltersdorfer commented on LUCENE-504:
    ----------------------------------------------

    Hi,

    something along the line of
    ScoreDoc[] results = searcher.search(query, MAX_NUMBER_OF_HITS).scoreDocs;
    causes a viable crash. I would consider this a "natural" start when trying to write an own searcher (MAX_NUMBER_OF_HITS beeing Integer.MAX_VALUE) and without the sources attached & the (eclipse) debugger I would have never found the problem I'd guess.
    So please do something about this pitfall, if only adding a warning in the javadoc of i.e. Searcher.search(..., int n, ...)

    Thanks
    Florian
    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
  • Ivan Rozhnov (JIRA) at Nov 2, 2009 at 9:46 am
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772479#action_12772479 ]

    Ivan Rozhnov commented on LUCENE-504:
    -------------------------------------

    Hi guys,

    It seems to me that problem is still opened. Can it be fixed with dynamic size of storage in PriorityQueue and couple of similar classes and using MaxClauseCount as top limit for size of such storage. It seems to be very weird to have preinitialized array of Max size in collection constructor.

    Thanks,
    Ivan
    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
  • Michael McCandless (JIRA) at Nov 3, 2009 at 10:22 am
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773001#action_12773001 ]

    Michael McCandless commented on LUCENE-504:
    -------------------------------------------

    Since 3.0 is now on Java 1.5, can't we switch to Java's PriorityQueue? Anyone want to cough up a patch?
    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
  • Uwe Schindler (JIRA) at Nov 3, 2009 at 6:25 pm
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773098#action_12773098 ]

    Uwe Schindler commented on LUCENE-504:
    --------------------------------------

    We had a discussion about that in another issue. In general PriorityQueue of Java 1.5 does not have the features we need for Java 1.5 (it dynamically grows, but the grow process is not controllable, making it unuseable for collecting TopDocs and so on). But I think for this special case, we could use Java 5's PQ.
    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
  • Uwe Schindler (JIRA) at Nov 3, 2009 at 6:29 pm
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773098#action_12773098 ]

    Uwe Schindler edited comment on LUCENE-504 at 11/3/09 6:27 PM:
    ---------------------------------------------------------------

    We had a discussion about that in another issue. In general PriorityQueue of Java 1.5 does not have the features we need for Lucene (it dynamically grows, but the grow process is not controllable, making it unuseable for collecting TopDocs and so on). But I think for this special case, we could use Java 5's PQ.

    was (Author: thetaphi):
    We had a discussion about that in another issue. In general PriorityQueue of Java 1.5 does not have the features we need for Java 1.5 (it dynamically grows, but the grow process is not controllable, making it unuseable for collecting TopDocs and so on). But I think for this special case, we could use Java 5's PQ.
    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
  • Nadav Har'El (JIRA) at Nov 4, 2009 at 7:17 am
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773402#action_12773402 ]

    Nadav Har'El commented on LUCENE-504:
    -------------------------------------

    Hi Uwe, I think that even though PriorityQueue doesn't have a size limit, it is easy to implement a size limit: after an add(), if size() becomes greater than the bound, you simply poll() to remove the lowest element (this poll() returns the old object which insertWithOverflow() is to return).

    However, I think it's a good idea to compare the performance of Java's PriorityQueue (used as in the paragraph above) . I'm especially worried about the slowdown by the fact that adding a small element (below the current heap's head) in our code just does one comparison and returns, but in the usage I described above it actually modifies the heap twice (adds the element to the heap and then removes it).
    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
  • Uwe Schindler (JIRA) at Nov 4, 2009 at 8:42 am
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773421#action_12773421 ]

    Uwe Schindler commented on LUCENE-504:
    --------------------------------------

    Nadav:
    I suggest to keep Lucene's PriorityQueue, because it is a very central and highly optimized part of Liucene. In Lucene 3.0 it is already generified, so it also fits perfectly into Java's Collection API. The only problem is that the name is now identical to one internal Java class, but we cannot change it without BW breaks.

    For this special issue, we should fix *only* FuzzyQuery to use Java5's PQ, which dynamically grows when new elements are added. And we do not need the upper limit here, like you propsed.

    I will prepare a patch tomorrow in the ApacheCon hacking session.
    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
  • Uwe Schindler (JIRA) at Nov 4, 2009 at 8:44 am
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773421#action_12773421 ]

    Uwe Schindler edited comment on LUCENE-504 at 11/4/09 8:43 AM:
    ---------------------------------------------------------------

    Nadav:
    I suggest to keep Lucene's PriorityQueue, because it is a very central and highly optimized part of Liucene. In Lucene 3.0 it is already generified, so it also fits perfectly into Java's Collection API. The only problem is that the name is now identical to one internal Java class, but we cannot change it without BW breaks.

    For this special issue, we should fix *only* FuzzyQuery to use Java5's PQ, which dynamically grows when new elements are added. And we do not need the upper limit here, like you propsed.

    I will prepare a patch tomorrow in the ApacheCon hacking session.

    *EDIT*

    We need the upper limit here, but we can implement it like you proposed.

    was (Author: thetaphi):
    Nadav:
    I suggest to keep Lucene's PriorityQueue, because it is a very central and highly optimized part of Liucene. In Lucene 3.0 it is already generified, so it also fits perfectly into Java's Collection API. The only problem is that the name is now identical to one internal Java class, but we cannot change it without BW breaks.

    For this special issue, we should fix *only* FuzzyQuery to use Java5's PQ, which dynamically grows when new elements are added. And we do not need the upper limit here, like you propsed.

    I will prepare a patch tomorrow in the ApacheCon hacking session.
    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
  • Uwe Schindler (JIRA) at Nov 4, 2009 at 5:11 pm
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Uwe Schindler updated LUCENE-504:
    ---------------------------------

    Attachment: LUCENE-504.patch

    Here is a patch for this issue, using j.u.PriorityQueue. It currently does not limit the PQ's number of entries, it just only consumes maxClauseCount ones.

    All tests pass, but they are no real test of the PQ behaviour, as the current test cases do not test more terms than maxClauseCount. So the tests pass in all cases, independent how the compareTo method looks like, so the ordering is not important because the queue never gets full. I will add a test.

    I will also try to implement the max size, but for now, the patch shows, how the code could look like with j.u.PQ.
    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, LUCENE-504.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
  • Uwe Schindler (JIRA) at Nov 4, 2009 at 9:49 pm
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Uwe Schindler updated LUCENE-504:
    ---------------------------------

    Attachment: LUCENE-504.patch

    Here a patch, that fixes FuzzyQuery. It uses j.u.PQ and has a small optimization to not add ScoreTerms, that would never be seen in the first maxClauseCount terms (tracking a bottom value).

    It also adds an testcase, where the maxClauseCount is lowerd downto 2 and the FuzzyQuery would hit 3 terms, so one too much. This tests the algorithm to not add this entry to the PQ.

    Nadav: The solution you propsed for limiting the number of entries in the PQ does not work, as poll() removes the head element of the queue, not the bottom that falls out. There is no way to remove the bottom value in Java's PQ easily. So we should j.u.PQ only for this issue.
    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, LUCENE-504.patch, LUCENE-504.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
  • Nadav Har'El (JIRA) at Nov 5, 2009 at 6:56 am
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773807#action_12773807 ]

    Nadav Har'El commented on LUCENE-504:
    -------------------------------------

    Uwe, you are right, I got confused... Sorry.
    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, LUCENE-504.patch, LUCENE-504.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
  • Uwe Schindler (JIRA) at Nov 6, 2009 at 6:44 pm
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774361#action_12774361 ]

    Uwe Schindler commented on LUCENE-504:
    --------------------------------------

    I think I take this one and commit it, is it ok? Thesolution seems to work quite good.
    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, LUCENE-504.patch, LUCENE-504.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
  • Uwe Schindler (JIRA) at Nov 6, 2009 at 8:14 pm
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Uwe Schindler reassigned LUCENE-504:
    ------------------------------------

    Assignee: Uwe Schindler
    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
    Assignee: Uwe Schindler
    Priority: Minor
    Attachments: BooleanQuery.java.diff, fuzzyquery.patch, LUCENE-504.patch, LUCENE-504.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
  • Uwe Schindler (JIRA) at Nov 6, 2009 at 8:16 pm
    [ https://issues.apache.org/jira/browse/LUCENE-504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Uwe Schindler resolved LUCENE-504.
    ----------------------------------

    Resolution: Fixed
    Fix Version/s: 3.0
    Lucene Fields: [Patch Available]

    Committed revision: 833544
    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
    Assignee: Uwe Schindler
    Priority: Minor
    Fix For: 3.0

    Attachments: BooleanQuery.java.diff, fuzzyquery.patch, LUCENE-504.patch, LUCENE-504.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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categorieslucene
postedMar 1, '06 at 2:54p
activeNov 6, '09 at 8:16p
posts27
users1
websitelucene.apache.org

1 user in discussion

Uwe Schindler (JIRA): 27 posts

People

Translate

site design / logo © 2021 Grokbase