1

I'm fairly new to c++ but I'm trying to learn. I've been tasked with implementing an old software called snpomatic in our pipelines. I could successfully build the program and run it with some datasets (i.e. a genome in fasta format and sequencing reads in fastq). However, I started getting segmentation fault errors if the fasta files used are above a size threshold (around 50-60 Mb).

I understand that it may be difficult because it's an already developed software, but I've been trying to investigate this. I wondered if anyone has any advice or could help, just in case I'm missing something easy enough.

So I've taken a look at the coredump (pasted below) and supposedly tracked the error to the line 20 in this script. I believe the stacked is overflowing when I use larger files, but I'm not sure on how I could address this.

Any advice would be appreciated. Thank you very much

The core dump by gdb:

Program terminated with signal SIGSEGV, Segmentation fault. #0 0x000055fad7b707f1 in TAlignmentOutput::add_align (this=<error reading variable: No se puede acceder a la memoria en la dirección 0x7ffca1fcd2d8>, seq=<error reading variable: No se puede acceder a la memoria en la dirección 0x7ffca1fcd2d0>, quality=<error reading variable: No se puede acceder a la memoria en la dirección 0x7ffca1fcd2c8>, pos=<error reading variable: No se puede acceder a la memoria en la dirección 0x7ffca1fcd2c4>, chromosome=<error reading variable: No se puede acceder a la memoria en la dirección 0x7ffca1fcd2c0>) at src/TAlignmentOutput.cpp:20 20 if ( align[twotoone(lane,pos)] + align[twotoone(lane,pos+seql/2-1)] + align[twotoone(lane,pos+seql-1)] == 96 ) break ;

JLR
  • 11
  • 1
  • 2
    You should probably examine the return values from `twotoone` and see how they compare with `align_size` ... or you could just run with valgrind or rebuild with the address sanitizer, and see what they tell you. – Useless Oct 13 '22 at 15:51
  • 1
    It'd be a lot better to strap this into a debugger so when it does blow a gasket you know exactly what's going on. We're unlikely to be able to help you with something too complex to explain in a question here. – tadman Oct 13 '22 at 15:53
  • *tracked the error to the line 20 in this script* -- It is called a *program* in C++, not "script". – PaulMcKenzie Oct 13 '22 at 16:02
  • @PaulMcKenzie: if it's executed dynamically from a string in memory I'd call it a C++ script. – Thomas Weller Oct 13 '22 at 16:07
  • Thank you all for your kind assistance on this one. I understand this is way to complex but you have already pointed me in the right direction. Thanks, I'll try – JLR Oct 13 '22 at 19:42

0 Answers0