You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/04/08 16:24:12 UTC

[jira] [Commented] (LUCENE-6409) LongBitSet.ensureCapacity overflows on numBits > Integer.MaxValue

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

ASF GitHub Bot commented on LUCENE-6409:
----------------------------------------

GitHub user LucVL opened a pull request:

    https://github.com/apache/lucene-solr/pull/140

    LUCENE-6409 BitSetFixes

    The pull request actually contains a few separate commits:
    - Demonstrates the bug in a simple test case and adds a patch.
    - Corrects ensureCapacity
    - Optimized bits2words for both FixedBitSet and LongBitSet


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/LucVL/lucene-solr lucene-6409-BitSetFixes

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucene-solr/pull/140.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #140
    
----
commit 44adaaa577839225f60a355fc3538631e0b9e965
Author: Luc Vanlerberghe <lu...@bvdinfo.com>
Date:   2014-12-12T15:48:23Z

    Demonstrate bug in LongBitSet.ensureCapacity

commit bb4257da61d45ab559ff8e3b23d9aa1d3981d366
Author: Luc Vanlerberghe <lu...@bvdinfo.com>
Date:   2014-12-12T15:53:54Z

    LongBitSet.ensureCapacity: Cast to long *before* shifting left!

commit a70e1d4b1b654e2e3655c289485af28ecdc9cd92
Author: Luc Vanlerberghe <lu...@bvdinfo.com>
Date:   2014-12-12T16:17:09Z

    Avoid an "if" in bits2words and corrected some comments

commit fd1cce82acd74a12aa4b022582985dfb8c8e4193
Author: Luc Vanlerberghe <lu...@bvdinfo.com>
Date:   2015-04-08T13:48:51Z

    Fixed grammar

commit 849dbf7a983040b50b32bd798ad191f8dd39bffb
Author: Luc Vanlerberghe <lu...@bvdinfo.com>
Date:   2015-04-08T13:49:45Z

    Merge branch 'trunk' into BitSetFixes

----


>  LongBitSet.ensureCapacity overflows on numBits > Integer.MaxValue 
> -------------------------------------------------------------------
>
>                 Key: LUCENE-6409
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6409
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/other
>            Reporter: Luc Vanlerberghe
>
> LongBitSet.ensureCapacity calculates the number of longs required to store the number of bits correctly and allocates a long[] accordingly, but then shifts the array length (which is an int!) left by 6 bits.  The int should be cast to long *before* performing the shift.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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