lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doron Cohen (JIRA)" <>
Subject [jira] Updated: (LUCENE-957) Lucene RAM Directory doesn't work for Index Size > 8 GB
Date Sun, 15 Jul 2007 21:54:04 GMT


Doron Cohen updated LUCENE-957:

    Attachment: lucene-957.patch

Previous patch apparently did not fix the bug - a casting problem in RAMOutputStream had to
be fixed. 
Updated patch adds a test imitating ramFile larger than maxint. 
For this had to make the allocation of a new byte array in RAMFile overridable. 
The new test fails before fixing RAMOutputStream (affecting RAMDirectory constructor from
FS). However the issues in RAMInputStream in fact do not cause failures, yet they should be

With a test in place I now feel confident in this fix - will commit it in a day or two if
there are no reservations.

> Lucene RAM Directory doesn't work for Index Size > 8 GB
> -------------------------------------------------------
>                 Key: LUCENE-957
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Store
>            Reporter: Doron Cohen
>            Assignee: Doron Cohen
>         Attachments: lucene-957.patch, lucene-957.patch
> from user list -
> Problem seems to be casting issues in RAMInputStream.
> Line 90:
>       bufferStart = BUFFER_SIZE * currentBufferIndex;
> both rhs are ints while lhs is long.
> so a very large product would first overflow MAX_INT, become negative, and only then
(auto) casted to long, but this is too late. 
> Line 91: 
>      bufferLength = (int) (length - bufferStart);
> both rhs are longs while lhs is int.
> so the (int) cast result may turn negative and the logic that follows would be wrong.

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:
For additional commands, e-mail:

View raw message