PASSIONLab / BELLA

BELLA: a Computationally-Efficient and Highly-Accurate Long-Read to Long-Read Aligner and Overlapper
Other
48 stars 8 forks source link

Segfault in matrix transpose #31

Open richardlett opened 3 years ago

richardlett commented 3 years ago

Issue I neglected earlier

Data set:

/project/projectdirs/mp309/bella-spgemm/ecoli_hifi_29x.fastq

Parameters:

-k 31 -l 20 -u 23

Fix:

The issue appears to be in include/common/transpose.h, ~ line 35.

for (IT i=0; i <= n; i++)
{
    cscColPtr[i+1] = atomicColPtr[i] + cscColPtr[i];
}

cscColPtr

is of length n+1 I believe (n rows, n+1 stores nnz).

However this writes at location n+1 (i.e. n+2nd element), causing out of bounds.

I believe the correct code would be

for (IT i=0; i < n; i++)

cscColPtr[i+1] already handles the +1 size correctly for the last index (n).

giuliaguidi commented 2 years ago

@richardlett has this been fixed?