Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7222 Discussions

Segmentation fault using dotc() and dotu(), MKL 8.1.1 on MacOSX 10.4.7

huil
Beginner
693 Views
Did anyone encounter this problem. The following code causes Segmentation fault (or Bus error in some other similar codes). I've submitted an issue about this.

--------------------------------------

struct cpl
{
double r;
double i;
};

extern "C"
{
cpl zdotc_ (int *N, cpl *X, int *IncX, cpl *Y, int *IncY);
}

int main ()
{

cpl c; c.r = c.i = 1;

cpl a[1] = {c}, b[1] = {c};

int i = 1; int n = 3;

cpl res = zdotc_(&n,a,&i,b,&i);

return 0;
}
0 Kudos
3 Replies
TimP
Honored Contributor III
693 Views
On linux, I don't get that failure. It does look as if you are forcing zdotc_() to read beyond the end of your declared a[] and b[].
0 Kudos
Intel_C_Intel
Employee
693 Views
Thanks fo replying. That's a typo in my posted code, when I was simplifying it.

But the runtime error still exists even that's corrected, something like "Illegal instruction".
0 Kudos
Intel_C_Intel
Employee
693 Views
I solved the problem. It was caused by incorrect using of Fortran functions returing a complex value, I found the following link: http://www.intel.com/support/performancetools/libraries/mkl/sb/cs-017175.htm#3
0 Kudos
Reply