lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] [Updated] (LUCENE-4114) Large docID / docvalue size combination produces arithmetic overflow
Date Tue, 05 Jun 2012 23:01:23 GMT


Michael McCandless updated LUCENE-4114:

    Attachment: LUCENE-4114.patch

Thanks Walt, nice find!

I attached patch w/ 3 places that could overflow ... can anyone find any others in the DocValues
> Large docID / docvalue size combination produces arithmetic overflow
> --------------------------------------------------------------------
>                 Key: LUCENE-4114
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: core/codecs
>    Affects Versions: 4.0, 5.0
>         Environment: Ubuntu 10.04
> Sun Java 6 b26
> MultiIndex over six directoryindices with ~80M documents each.
>            Reporter: Walt Elder
>             Fix For: 4.0, 5.0
>         Attachments: LUCENE-4114.patch
>   Original Estimate: 2h
>  Remaining Estimate: 2h
> My test case has run across an arithmetic bug in FixedStraightBytesImpl - specifically
in the @Override on position(int). The combination of size=32 and docID = 70M produces a negative
integer and causes a stacktrace in which I will post below.  I would
imagine that this hasn't been hit before because most index shards have less than 70M documents.
> That is to say, when asking for the docvalue in a FixedStraightBytes field where the
size of values are 32 and the docID can be sufficiently high, an arithmetic overflow occurs
in line 359 of, causing the method to return a negative value
when operating on the first (0th) shard with a baseOffset of 0.  This produces an IllegalArgumentException:
> Caused by: java.lang.IllegalArgumentException: Seeking to negative position: MMapIndexInput(_7_5_dv.dat
in path="/.../_7_dv.cfs" slice=5:2562955684)
>         at$
>         at org.apache.lucene.codecs.lucene40.values.FixedStraightBytesImpl$DirectFixedStraightSource.position(
>         at org.apache.lucene.codecs.lucene40.values.DirectSource.getBytes(
>         at org.apache.lucene.codecs.lucene40.values.FixedStraightBytesImpl$DirectFixedStraightSource.getBytes(
>         ...

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


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

View raw message