- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
In our code, we encounter a problem. I've isolated it for you.
When you call LAPACKE_cgesvd_work or LAPACKE_zgesvd_work, you may encounter a segfault.
But the case is very specific. You have an example below.
It occurs only if N=2. I've done a loop from 0 to 100000, and only N=2 creates the segfault.
#include <lapacke.h>
#include <cblas.h>
#include <complex.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
int64_t ret, N=2;
float complex querysize;
ret = LAPACKE_cgesvd_work( LAPACK_COL_MAJOR, 'S', 'S',
N, N, NULL, N,
NULL, NULL, N, NULL, N,
&querysize, -1, NULL );
printf( "[%ld] %f + i*%f\n", (long)N, creal(querysize), cimag(querysize) );
return ret;
}
This example was compiled thanks to the following command :
gcc ${your_name}.c -L/opt/intel/oneapi/mkl/2021.4.0/lib/intel64/ -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -pthread -lm -ldl (to correspond with our software).
We observe that this problem doesn't appear in real cases, only with complex ones.
Can you reproduce this bug ?
Regards,
Tony Delarue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue would be fixed in the next release/update.
There is a simple workaround for the issue consisting in the replacement of call:
ret = LAPACKE_cgesvd_work( LAPACK_COL_MAJOR, 'S', 'S',
N, N, NULL, N,
NULL, NULL, N, NULL, N,
&querysize, -1, NULL);
with
float rwork[1];
ret = LAPACKE_cgesvd_work( LAPACK_COL_MAJOR, 'S', 'S',
N, N, NULL, N,
NULL, NULL, N, NULL, N,
&querysize, -1, rwork );
We will keep this tread updated when the fix would be released.
-Gennady
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tony,
before checking the case, I see that you use int64_t type of N. Could you check the problem with int N = 2 instead of int64_t?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Same result. Core dump. Here you have the backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff1cad2a4 in mkl_lapack_cgesvd_small () from /opt/intel/oneapi/mkl/2021.4.0/lib/intel64/libmkl_core.so.1
(gdb) bt
#0 0x00007ffff1cad2a4 in mkl_lapack_cgesvd_small () from /opt/intel/oneapi/mkl/2021.4.0/lib/intel64/libmkl_core.so.1
#1 0x00007ffff1d0a58a in mkl_lapack_cgesvd () from /opt/intel/oneapi/mkl/2021.4.0/lib/intel64/libmkl_core.so.1
#2 0x00007ffff778f480 in mkl_lapack.cgesvd_ () from /opt/intel/oneapi/mkl/2021.4.0/lib/intel64/libmkl_gf_lp64.so.1
#3 0x00007ffff7953b47 in LAPACKE_cgesvd_work () from /opt/intel/oneapi/mkl/2021.4.0/lib/intel64/libmkl_gf_lp64.so.1
#4 0x00005555555551ef in main () at /home/tdelarue/intel.c:11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok, we will take a look at this case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, we confirmed the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue would be fixed in the next release/update.
There is a simple workaround for the issue consisting in the replacement of call:
ret = LAPACKE_cgesvd_work( LAPACK_COL_MAJOR, 'S', 'S',
N, N, NULL, N,
NULL, NULL, N, NULL, N,
&querysize, -1, NULL);
with
float rwork[1];
ret = LAPACKE_cgesvd_work( LAPACK_COL_MAJOR, 'S', 'S',
N, N, NULL, N,
NULL, NULL, N, NULL, N,
&querysize, -1, rwork );
We will keep this tread updated when the fix would be released.
-Gennady

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page