lorrainea / MARS

MARS: improving Multiple circular sequence Alignment using Refined Sequences
GNU General Public License v3.0
27 stars 9 forks source link

Segmentation fault on the example #7

Closed maciejmotyka closed 5 years ago

maciejmotyka commented 5 years ago

Similar to #4 but occurs at later stage of the algorythm. Repo cloned on 30 Oct 2019. Make finished successfully.

$ ./mars -a DNA -m 0 -i ./data/10.gappy.fasta -o ./data/10.gappy.output.fasta -q 5 -l 20 -P 1 -T 8
 Reading the (Multi)FASTA input file: ./data/10.gappy.fasta
 Computing cyclic edit distance for all sequence pairs
 Creating the guide tree
 Starting progressive alignment
[2]    19122 segmentation fault (core dumped)  ./mars -a DNA -m 0 -i ./data/10.gappy.fasta -o ./data/10.gappy.output.fasta -
$ free
              total        used        free      shared  buff/cache   available
Mem:          7.5Gi       567Mi       5.1Gi        82Mi       1.9Gi       6.6Gi
Swap:          11Gi       393Mi        11Gi
Total:         19Gi       960Mi        16Gi
$ valgrind ./mars -a DNA -m 0 -i ./data/10.gappy.fasta -o ./data/10.gappy.output.fasta -q 5 -l 20 -P 1 -T 8

==27814== 
 Reading the (Multi)FASTA input file: ./data/10.gappy.fasta
 Computing cyclic edit distance for all sequence pairs
 Creating the guide tree
 Starting progressive alignment
==27814== Invalid free() / delete / delete[] / realloc()
==27814==    at 0x483BFBF: operator delete(void*) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==27814==    by 0x10AA67: alignSequences(std::vector<unsigned char*, std::allocator<unsigned char*> >*, std::vector<unsigned char*, std::allocator<unsigned char*> >*, std::vector<int, std::allocator<int> >*, std::vector<int, std::allocator<int> >*, unsigned char**, int**&) [clone .cold] (progAlignment.cc:452)
==27814==    by 0x434A0F3AA08278FF: ???
==27814==    by 0x800000005: ???
==27814==    by 0x500000013: ???
==27814==  Address 0x64 is not stack'd, malloc'd or (recently) free'd
==27814== 
==27814== Invalid read of size 8
==27814==    at 0x4BF3473: _Unwind_Resume (in /usr/lib/x86_64-linux-gnu/libgcc_s.so.1)
==27814==    by 0x10AA6F: alignSequences(std::vector<unsigned char*, std::allocator<unsigned char*> >*, std::vector<unsigned char*, std::allocator<unsigned char*> >*, std::vector<int, std::allocator<int> >*, std::vector<int, std::allocator<int> >*, unsigned char**, int**&) [clone .cold] (progAlignment.cc:452)
==27814==    by 0x434A0F3AA08278FF: ???
==27814==    by 0x800000005: ???
==27814==    by 0x500000013: ???
==27814==  Address 0x73 is not stack'd, malloc'd or (recently) free'd
==27814== 
==27814== 
==27814== Process terminating with default action of signal 11 (SIGSEGV)
==27814==  Access not within mapped region at address 0x73
==27814==    at 0x4BF3473: _Unwind_Resume (in /usr/lib/x86_64-linux-gnu/libgcc_s.so.1)
==27814==    by 0x10AA6F: alignSequences(std::vector<unsigned char*, std::allocator<unsigned char*> >*, std::vector<unsigned char*, std::allocator<unsigned char*> >*, std::vector<int, std::allocator<int> >*, std::vector<int, std::allocator<int> >*, unsigned char**, int**&) [clone .cold] (progAlignment.cc:452)
==27814==    by 0x434A0F3AA08278FF: ???
==27814==    by 0x800000005: ???
==27814==    by 0x500000013: ???
==27814==  If you believe this happened as a result of a stack
==27814==  overflow in your program's main thread (unlikely but
==27814==  possible), you can try to increase the size of the
==27814==  main thread stack using the --main-stacksize= flag.
==27814==  The main thread stack size used in this run was 8388608.
==27814== 
==27814== HEAP SUMMARY:
==27814==     in use at exit: 3,838,502 bytes in 274 blocks
==27814==   total heap usage: 19,581 allocs, 19,308 frees, 9,653,914 bytes allocated
==27814== 
==27814== LEAK SUMMARY:
==27814==    definitely lost: 364 bytes in 91 blocks
==27814==    indirectly lost: 0 bytes in 0 blocks
==27814==      possibly lost: 2,128 bytes in 7 blocks
==27814==    still reachable: 3,836,010 bytes in 176 blocks
==27814==         suppressed: 0 bytes in 0 blocks
==27814== Rerun with --leak-check=full to see details of leaked memory
==27814== 
==27814== For lists of detected and suppressed errors, rerun with: -s
==27814== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
[2]    27814 segmentation fault (core dumped)  valgrind ./mars -a DNA -m 0 -i ./data/10.gappy.fasta -o  -q 5 -l 20 -P 1 -T 8
lorrainea commented 5 years ago

We have tested this on a number of operating systems and compilers and this runs with no errors. What compiler version are you using and which operating system?

maciejmotyka commented 5 years ago

I'm on Ubuntu MATE 19.10. Compiler is g++ (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008

pre-install.sh finishes without errors, but returns quite a lot of warnings. pre-install.sh.log

The compilation command is g++ -g -fopenmp -D_USE_OMP -msse4.2 -O3 -fomit-frame-pointer -funroll-loops -c -std=c++11 -I ./ -I ./libsdsl/include/ -L ./libsdsl/lib/ -lsdsl -ldivsufsort -ldivsufsort64 -Wl,-rpath=/home/lejno/MARS/libsdsl/lib and it returns warnings for nj.cc, progAlignment.cc and bb.cc, but no errors. make.log

lorrainea commented 5 years ago

Please try to pull the new changes and let me know if you still get any errors.

maciejmotyka commented 5 years ago

Works now. Thanks! FYI: