lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Høydahl (JIRA) <>
Subject [jira] [Commented] (LUCENE-4074) FST Sorter BufferSize causes int overflow if BufferSize > 2048MB
Date Fri, 25 May 2012 11:13:23 GMT


Jan Høydahl commented on LUCENE-4074:

Checked in a fix in 3.6 for non-compiling TestSort.testRamBuffer. It referred to random().nextInt()
instead of random.nextInt() - clear copy/paste error from Trunk code
> FST Sorter BufferSize causes int overflow if BufferSize > 2048MB
> ----------------------------------------------------------------
>                 Key: LUCENE-4074
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: modules/spellchecker
>    Affects Versions: 3.6, 4.0
>            Reporter: Simon Willnauer
>            Assignee: Simon Willnauer
>             Fix For: 4.0, 3.6.1
>         Attachments: LUCENE-4074.patch
> the BufferSize constructor accepts size in MB as an integer and uses multiplication to
convert to bytes. While its checking the size in bytes to be less than 2048 MB it does that
after byte conversion. If you pass a value > 2047 to the ctor the value overflows since
all constants and methods based on MB expect 32 bit signed ints. This does not even result
in an exception until the BufferSize is actually passed to the sorter.

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