You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Taylan Develioglu (JIRA)" <ji...@apache.org> on 2013/08/21 18:02:51 UTC
[jira] [Issue Comment Deleted] (CASSANDRA-5903) Integer overflow in
OffHeapBitSet when bloomfilter > 2GB
[ https://issues.apache.org/jira/browse/CASSANDRA-5903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Taylan Develioglu updated CASSANDRA-5903:
-----------------------------------------
Comment: was deleted
(was: diff --git a/src/java/org/apache/cassandra/utils/obs/OffHeapBitSet.java b/src/java/org/apache/cassandra/utils/obs/OffHeapBitSet.java
index b7bb733..fb32043 100644
--- a/src/java/org/apache/cassandra/utils/obs/OffHeapBitSet.java
+++ b/src/java/org/apache/cassandra/utils/obs/OffHeapBitSet.java
@@ -119,9 +119,9 @@ public class OffHeapBitSet implements IBitSet
public static OffHeapBitSet deserialize(DataInput dis) throws IOException
{
- int byteCount = dis.readInt() * 8;
+ long byteCount = dis.readInt() * 8L;
Memory memory = RefCountedMemory.allocate(byteCount);
- for (int i = 0; i < byteCount;)
+ for (long i = 0; i < byteCount;)
{
long v = dis.readLong();
memory.setByte(i++, (byte) (v >>> 0));
)
> Integer overflow in OffHeapBitSet when bloomfilter > 2GB
> --------------------------------------------------------
>
> Key: CASSANDRA-5903
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5903
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Reporter: Taylan Develioglu
> Assignee: Vijay
> Labels: patch
> Fix For: 1.2.9
>
> Attachments: 0001-CASSANDRA-5903.patch
>
>
> In org.apache.cassandra.utils.obs.OffHeapBitSet.
> byteCount overflows and causes an IllegalArgument exception in Memory.allocate when bloomfilter is > 2GB.
> Suggest changing byteCount to long.
> {code:title=OffHeapBitSet.java}
> public OffHeapBitSet(long numBits)
> {
> // OpenBitSet.bits2words calculation is there for backward compatibility.
> int byteCount = OpenBitSet.bits2words(numBits) * 8;
> bytes = RefCountedMemory.allocate(byteCount);
> // flush/clear the existing memory.
> clear();
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira