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

Memory leak in SearchPath() for MKL 7.2.1

metamerik
Beginner
538 Views
I was using MKL 7.2.1 on Linux Fedora 9 with EM64T architecture and discovered a memory leak in function SearchPath(), which is defined in the library em64t/libmkl_lapack.a. Here's how to reproduce the problem:

1. Have program which uses MKL, for example:
===========program matinv
implicit none
external sgesv
real :: g3(2,2) = (/ 0d0, 1d0, 2d0, 3d0 /)
real :: gu3(2,2) = (/ 1d0, 0d0, 0d0, 1d0 /)
integer :: ipiv(2) = (/ 1, 2 /)
integer :: info
integer :: n=2, nrhs=2

write (*,*) "Calling sgesv..."
call sgesv (n, nrhs, g3, n, ipiv, gu3, n, info)
write (*,*) "inv(g3) = ", gu3

end program matinv
=============

2. Compile it (I enforce static here to ensure independence of environment):
ifort -static matinv.F90 -L/usr/local/packages/numrel/opt/intel/mkl721/lib/em64t -lmkl_lapack -lmkl_em64t -lguide -lpthread -o matinv.x

3. Have a long sophisticated PATH environment variable with repeated entries:
export PATH=$PATH:$PATH:$PATH

4. Run the program:
./matinv.x
Calling sgesv...
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
matinv.x 0000000000402F29 Unknown Unknown Unknown

Stack trace terminated abnormally.

Debugger's backtrace shows that the error happens in function SearchPath(), which is a symbol in libmkl_lapack.a library. Initially, with much more compex example, I was getting a segmentation fault which looked like this:
p0_6279: p4_error: interrupt SIGSEGV: 11

Debugger still shows problems in SearchPath, and this behaviour is affected by PATH variable in a strange way. I can't tell exactly what in my $PATH offends SearchPath function so much, whether it is repeated entries, or too many entries, or some special symbols.

Is this fixed in later versions of MKL? Which version should I pick for my architecture? I tried 10.1.019, but probably it is not free for EM64T even for non-commercial usage, because my license file gets rejected with a message:
---
The license file(s) you provided is not valid for this product.
---

Thanks.

0 Kudos
1 Reply
metamerik
Beginner
538 Views
Just installed MKL 9,1.023 and the problem disappeared.
0 Kudos
Reply