Illegal instruction debug

gmarco picture gmarco · Mar 17, 2014 · Viewed 8.1k times · Source

I've compiled a whole suite of bioinformatics analysis. (https://github.com/iontorrent/TS) It has a lot of dependencies (armadillo, blas, lapack, atlas etc..).

On compilation I had no errors. The problem is that some of the executable file created are not working and throw an Illegal Instruccion without any other information. I'm using GCC 4.8.2 on a CentOS 5.6.

I would like to know how can I debug those executable files, so I can check which one of the libraries or code is wrong in my system.

./tvc
tvc 4.0-7 () - Torrent Variant Caller

Illegal instruction

I think the issue is with LAPACK/BLAS/CBLAS. I'm very confused on how to build LAPACK/BLAS and CBLAS from source. (rpm version of LAPACK/BLAS is outdated in Centos 5, this software suite needs LAPACK 3.2.1). I know how to compile LAPACK and BLAS, I've no idea on how to install CBLAS.

Thank you.

Edited:

The guys providing this analysis suite they also provide a VM with a pre-installed Ubuntu and all the software.

I took a look of their gcc version and configuration:

gcc -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5.1'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)

My GCC configuration:

Configured with: ../configure --prefix=/share/apps/local/gcc/4.8.2 --with-mpfr=/share/apps/local/gcc/4.8.2 --with-gmp=/share/apps/local/gcc/4.8.2 --with-as=/share/apps/local/binutils/2.24/bin/as --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.8.2 (GCC) 

Answer

Michael Conlen picture Michael Conlen · May 25, 2014

There's a couple of possibilities; but to work it out run the program in the debugger as stated

$ gdb ./tvc

from the debugger run the program. Note: (gdb) is the prompt

(gdb) run

This should throw the illegal instruction; from here run

(gdb) bt full

This will tell you where the illegal instruction happened.