[Mulgara-dev] NegativeArraySizeException

Alex Hall alexhall at revelytix.com
Tue Nov 11 15:34:39 UTC 2008


Excellent.  I've committed the patch to the trunk, so it should be
available on your next update.

-Alex

James Leigh wrote:
> The latest from trunk plus this patch allows Mulgara to execute the
> query and others like it without an exception.
>
> Thanks Alex.
>
> On Thu, 2008-11-06 at 10:08 -0500, Alex Hall wrote:
>   
>> James Leigh wrote:
>>     
>>> Hi Paul et al,
>>>
>>> I loaded up 25m of BSBM data and executed a query like the one below.
>>> Instead of getting any results, I got this exception. In
>>> HybridTuples.java it casts a long into an int. This may account for the
>>> int being negative. I have the dataset on another machine and can make
>>> it and the exact query available if desired. Paul can you review
>>> HybridTuples and DenseLongMatrix and make sure the long/int handling is
>>> correct?
>>>       
>> Just taking a quick look here...  When the LeftJoin operation calculates the
>> upper bound of its row count, it multiplies a long by a long without checking
>> for overflow, which is how I suspect that the negative value is creeping in.  If
>> you're building from source, try applying the attached patch and let me know if
>> it fixes the problem.
>>
>> Regards,
>> Alex
>> plain text document attachment (LeftJoin.txt)
>> Index: C:/Mulgara/trunk/src/jar/tuples/java/org/mulgara/store/tuples/LeftJoin.java
>> ===================================================================
>> --- C:/Mulgara/trunk/src/jar/tuples/java/org/mulgara/store/tuples/LeftJoin.java	(revision 1373)
>> +++ C:/Mulgara/trunk/src/jar/tuples/java/org/mulgara/store/tuples/LeftJoin.java	(working copy)
>> @@ -175,7 +175,7 @@
>>    public long getRowUpperBound() throws TuplesException {
>>      BigInteger rowCount = BigInteger.valueOf(lhs.getRowUpperBound());
>>      rowCount = rowCount.multiply(BigInteger.valueOf(rhs.getRowUpperBound()));
>> -    return rowCount.longValue();
>> +    return rowCount.bitLength() > 63 ? Long.MAX_VALUE : rowCount.longValue();
>>    }
>>  
>>
>> _______________________________________________
>> Mulgara-dev mailing list
>> Mulgara-dev at mulgara.org
>> http://mulgara.org/mailman/listinfo/mulgara-dev
>>     
>
> _______________________________________________
> Mulgara-dev mailing list
> Mulgara-dev at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-dev
>   



More information about the Mulgara-dev mailing list