Closed tsgouros closed 2 years ago
Hey @tsgouros, I was actually a little perplexed at first. Segfaults in julia should be nonexistant/rare-- usually for me it means the cluster killed my job for using too much memory. but If you look at the code I wrote, there is an @inbounds
macro which is removing normal bounds checking for the sake of efficiency. I probably felt sure that all the code in that block was going to be inbounds. You however, are working within that block and likely trying to access an array index based on mismatch # that doesn't exist-- Can you try removing the macro and re-run? My guess is you'll get an out of bounds error.
Your guess seems to be correct, thank you. But apparently if I specify "--mismatches 20" on the command line, apparently the mismatch field of the score object sometimes comes back as 21. Not sure what that would imply.
Ahh yeah, I think it implies that I set the alignment breaking criteria as mismatches > threshold, so 21 > 20 ends the alignment and returns.
Aha! Thanks.
When I use --mismatches 10 or --mismatches 20, I get a segfault in reads.jl. That is, it doesn't happen at the same point of execution when I operate on the same data. But it happens on accesses to fwd_aln. I have modified read.jl to write a fastq file of data from a specific gene (see #121 ) but that part seems to work fine. If I don't specify the --mismatches option, it runs fine.
You can see my modified source file at https://github.com/tsgouros/Whippet.jl/blob/count-errors/src/reads.jl The error reports happening either on line 158 (original code) or sometimes on line 173 (my code).
The problem is in process_paired_reads(). I did something similar to this with unpaired reads a couple of months ago and had no such problem. This is julia 1.6.2, on linux, 4.18.0.
A traceback is below. Any ideas?