Closed ekg closed 2 years ago
I think that 1024 thing is a good clue. From what I can tell, abpoa calls abpoa_realloc_seq()
from the command line when it's loading the sequences from file with abpoa_read_seq()
. But since we're passing in the sequences directly to memory, I don't think that realloc is ever getting called, so we're stuck with the default value of 1024? (still weird asan wouldn't get that if this were the case).
I run it on a test 2000 x 1000bp dataset and did not see this segfault.
As @ekg mentioned the error related to the variable comment
in abpoa_seq_t
,
I suspect that you guys did not reallocate it when loading more than 1024 sequences?
But I am not very sure about this.
How do we reallocate when there are more than 1024 sequences? We are either calling abpoa_msa or abpoa_poa to drive the alignment.
Also, the error indicates that something else has written to the comment variable. If a memory address had been written, I don't think it would be possible to get the "high value address" that lies outside of the virtual memory of the system (in 48 bits).
@ekg You are right, they should be reallocated inside the abpoa_msa
function.
I just found that realloc bug and fixed it.
Please try the latest commit.
Yan
Talking with @glennhickey today, we discovered that we are both struggling with a segfault that appears to occur when calling
abpoa_free_seq
. I specifically tracked it to here: https://github.com/yangao07/abPOA/blob/master/src/abpoa_seq.c#L110. It appears that this only occurs when aligning >1024 (CHUNK_READ_N
) sequences. I am interested in the fact that the initial default allocation is for 1024 sequences https://github.com/yangao07/abPOA/blob/bc41c3d8a896cc7390b0e30f67bac731c9569bed/src/abpoa_seq.c#L96.However, neither of us have been able to reproduce this using the same input and calling the command line
abpoa
tool. This will make it very hard for you to track down the cause.Adjusting things to attempt to narrow down the problem, I saw errors like this that suggested that the address of one of the values to be freed had been overwritten by a number. This number is outside of the normal 48-bits used for memory addresses:
We're both trying to find an input to abpoa that reproduces this error.