Cannot run BLAS/LAPACK debug version
Hi,
Thank you for supporting a very useful library.
I'm successfully using BLAS/LAPACK libraries on Fedora Core 7 (Moonshine) on x86_64. However, my code won't run with debug-enabled versions of the libraries. I would very much appreciate it, if I could get a clue what's going wrong here.
I'm using the following packages:
blas-3.1.1-1.fc7 (for the non-debug version of blas)
lapack-debuginfo-3.1.1-1.fc7 (for the debug version of blas).
Thank you in advance for your assistance,
Michael.
PS: please find below C source code for a very small test executable, that exhibits the problem. This file contains the building instructions (which are straightforward), as well as some debug info. I tried to instead attach the file, but every attempt failed.
------START OF FILE ---------------------
/* This is a simple program, that copies a source array of length LENGTH of
floats into a similar destination array. BLAS routine scopy_(..) is
used. This code segfaults reproducibly, when linked against the debug version
of BLAS library, but executes OK when linked against the release version of
this library, that comes with ATLAS package. The test system runs x86_64
distribution of Fedora Core 7 (Moonshine) Linux on an AMD64 platform. It's
not clear, whether the issue is x86_64 specific. */
/* Instructions for reproducing the segfault:
1. Deploy lapack-debuginfo-3.1.1-1.fc7.x86_64.rpm on a Linux Fedora Core 7
(Moonshine) system.
2. Set up a symbolic link between
/usr/lib/debug/usr/lib64/libblas.so.3.1.1.debug and libblas.so (in the same
directory). Libblas.so is not shipped with lapack-debuginfo's RPM.
3. Make this source file into an executable, as explained below, then run it
from the command line, from its home directory. Observe a segfault.
4. In order to reproduce the no-segfault scenario (linkage against stock Fedora
Core libblas), replace `/usr/lib/debug/usr/lib64' string with `/usr/lib64/atlas'
string in the make command below.
------------------------------
Make instructions (using gnumake):
$ make LOADLIBES=-L/usr/lib/debug/usr/lib64 LDLIBS="-lblas -lgfortran" blastest
This command results in the following cc command:
cc blastest.c -L/usr/lib/debug/usr/lib64 -lblas -lgfortran -o blastest
------------------------------
ldd on the executable shows the following:
$ ldd ./blastest
linux-vdso.so.1 => (0x00007fff779fd000)
libblas.so => /usr/lib/debug/usr/lib64/libblas.so (0x00002aaaaaaad000)
libgfortran.so.1 => /usr/lib64/libgfortran.so.1 (0x00000031ca400000)
libc.so.6 => /lib64/libc.so.6 (0x00000031c8800000)
libm.so.6 => /lib64/libm.so.6 (0x00000031c8c00000)
/lib64/ld-linux-x86-64.so.2 (0x00000031c7800000)
Note, that only blas library comes with debug info, other libraries are from the
standard Fedora Core deployment.
-------------------------------
The following is cut-n-pasted from a gdb session on the crashing executable:
(gdb) r
Starting program: /home/siguc/tmp/exp/blastest
(no debugging symbols found)
warning: no loadable sections found in added symbol-file system-supplied DSO at
0x7fff7c3fd000
(no debugging symbols found)
Program received signal SIGSEGV, Segmentation fault.
0x00000031c780a2f2 in _dl_relocate_object () from /lib64/ld-linux-x86-64.so.2
(gdb) bt
#0 0x00000031c780a2f2 in _dl_relocate_object ()
from /lib64/ld-linux-x86-64.so.2
#1 0x00000031c780373c in dl_main () from /lib64/ld-linux-x86-64.so.2
#2 0x00000031c78131fb in _dl_sysdep_start () from /lib64/ld-linux-x86-64.so.2
#3 0x00000031c78023b0 in _dl_start () from /lib64/ld-linux-x86-64.so.2
#4 0x00000031c7800a68 in _start () from /lib64/ld-linux-x86-64.so.2
#5 0x0000000000000001 in ?? ()
#6 0x00007fff7c36c902 in ?? ()
#7 0x0000000000000000 in ?? ()
(gdb)
*/
#define LENGTH 10
extern int scopy_(const int* const N,
const float* const X,
const int* const INCX,
float* const Y,
const int* const INCY );
int main() {
float x[LENGTH], y[LENGTH];
int n = LENGTH, incx = 1, incy = 1, i;
/* Initialize the source array with some data. */
for (i = 0; i < LENGTH; ++ i)
x[i] = i;
scopy_(&n, x, &incx, y, &incy);
return 0;
}
----------END OF FILE -----------------------
Thank you for supporting a very useful library.
I'm successfully using BLAS/LAPACK libraries on Fedora Core 7 (Moonshine) on x86_64. However, my code won't run with debug-enabled versions of the libraries. I would very much appreciate it, if I could get a clue what's going wrong here.
I'm using the following packages:
blas-3.1.1-1.fc7 (for the non-debug version of blas)
lapack-debuginfo-3.1.1-1.fc7 (for the debug version of blas).
Thank you in advance for your assistance,
Michael.
PS: please find below C source code for a very small test executable, that exhibits the problem. This file contains the building instructions (which are straightforward), as well as some debug info. I tried to instead attach the file, but every attempt failed.
------START OF FILE ---------------------
/* This is a simple program, that copies a source array of length LENGTH of
floats into a similar destination array. BLAS routine scopy_(..) is
used. This code segfaults reproducibly, when linked against the debug version
of BLAS library, but executes OK when linked against the release version of
this library, that comes with ATLAS package. The test system runs x86_64
distribution of Fedora Core 7 (Moonshine) Linux on an AMD64 platform. It's
not clear, whether the issue is x86_64 specific. */
/* Instructions for reproducing the segfault:
1. Deploy lapack-debuginfo-3.1.1-1.fc7.x86_64.rpm on a Linux Fedora Core 7
(Moonshine) system.
2. Set up a symbolic link between
/usr/lib/debug/usr/lib64/libblas.so.3.1.1.debug and libblas.so (in the same
directory). Libblas.so is not shipped with lapack-debuginfo's RPM.
3. Make this source file into an executable, as explained below, then run it
from the command line, from its home directory. Observe a segfault.
4. In order to reproduce the no-segfault scenario (linkage against stock Fedora
Core libblas), replace `/usr/lib/debug/usr/lib64' string with `/usr/lib64/atlas'
string in the make command below.
------------------------------
Make instructions (using gnumake):
$ make LOADLIBES=-L/usr/lib/debug/usr/lib64 LDLIBS="-lblas -lgfortran" blastest
This command results in the following cc command:
cc blastest.c -L/usr/lib/debug/usr/lib64 -lblas -lgfortran -o blastest
------------------------------
ldd on the executable shows the following:
$ ldd ./blastest
linux-vdso.so.1 => (0x00007fff779fd000)
libblas.so => /usr/lib/debug/usr/lib64/libblas.so (0x00002aaaaaaad000)
libgfortran.so.1 => /usr/lib64/libgfortran.so.1 (0x00000031ca400000)
libc.so.6 => /lib64/libc.so.6 (0x00000031c8800000)
libm.so.6 => /lib64/libm.so.6 (0x00000031c8c00000)
/lib64/ld-linux-x86-64.so.2 (0x00000031c7800000)
Note, that only blas library comes with debug info, other libraries are from the
standard Fedora Core deployment.
-------------------------------
The following is cut-n-pasted from a gdb session on the crashing executable:
(gdb) r
Starting program: /home/siguc/tmp/exp/blastest
(no debugging symbols found)
warning: no loadable sections found in added symbol-file system-supplied DSO at
0x7fff7c3fd000
(no debugging symbols found)
Program received signal SIGSEGV, Segmentation fault.
0x00000031c780a2f2 in _dl_relocate_object () from /lib64/ld-linux-x86-64.so.2
(gdb) bt
#0 0x00000031c780a2f2 in _dl_relocate_object ()
from /lib64/ld-linux-x86-64.so.2
#1 0x00000031c780373c in dl_main () from /lib64/ld-linux-x86-64.so.2
#2 0x00000031c78131fb in _dl_sysdep_start () from /lib64/ld-linux-x86-64.so.2
#3 0x00000031c78023b0 in _dl_start () from /lib64/ld-linux-x86-64.so.2
#4 0x00000031c7800a68 in _start () from /lib64/ld-linux-x86-64.so.2
#5 0x0000000000000001 in ?? ()
#6 0x00007fff7c36c902 in ?? ()
#7 0x0000000000000000 in ?? ()
(gdb)
*/
#define LENGTH 10
extern int scopy_(const int* const N,
const float* const X,
const int* const INCX,
float* const Y,
const int* const INCY );
int main() {
float x[LENGTH], y[LENGTH];
int n = LENGTH, incx = 1, incy = 1, i;
/* Initialize the source array with some data. */
for (i = 0; i < LENGTH; ++ i)
x[i] = i;
scopy_(&n, x, &incx, y, &incy);
return 0;
}
----------END OF FILE -----------------------