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

mkl_freeBuffer() access violation exception error

mmmmm__hamed
Beginner
516 Views

hi 

i use mkl c++ compiler 11.0.066 and mkl10.1 and c++/clr vs2008

i use fft and conv function from mkl in multi thread realtime application (each thread exec fft and conv parallel)

but after little time usage memory go up and application crash.

with any leak detector i cant find any leakage in my code .

recently i study mkl help and find i must use mkl_FreeBuffer() after mkl function for avoidance memory leakage

but when i call mkl_freeBuffer Application crash with access violation exception.

what shoud i do?

i use 64 bit mkl

 additional library directory  -> em64t\lib 

additional dependecy -> mkl_intel_lp64_dll.lib   ;    mkl_intel_thread_dll.lib     ;  mkl_core_dll.lib

thanks for you.

0 Kudos
8 Replies
Bernard
Valued Contributor I
516 Views

Do you have callstack info?

0 Kudos
Judith_W_Intel
Employee
516 Views

 

This question would probably be more appropriate for the MKL forum not the compiler forum.

https://software.intel.com/en-us/forums/intel-math-kernel-library

Good luck,

Judy

0 Kudos
KitturGanesh
Employee
516 Views

Hi,

I'll transfer this issue to MKL forum so someone from that group can address this accordingly....

_Kittur

0 Kudos
Gennady_F_Intel
Moderator
516 Views

Can you give us the example of your test which we can compile and check the problem with the latest version of MKL?

or you can try to evaluate the latest updates by yourself.

0 Kudos
mmmmm__hamed
Beginner
516 Views

this is my code 

mkl_complex16*  intelForwardFft (MKL_Complex16* input,int length)

{

            DFTI_DESCRIPTOR *fft_handle;

           dfticreatedescriptor(&fft_handle,dfti_double,dfti_complex,1,length) ;

           dftisetvalue(fft_handle,dfti_placement,dfti_inplace);

          dfti_computeforward(fft_handle,input);

          dftifreedescriptor(&fft_handle);

          mkl_FreeBuffers();

          return input;     ===>cursor stop here

}

MKL_Complex16*  Convolution(MKL_Complex16*  x,int   xlength, MKL_Complex16*  y  ,  int ylength )

{

          int convResLength=xlength+ylength-1;

          VSLCONVTASKPTR   task;

           VSLCONVTASKPTR*   task-ptr;

           int   iy0=0;

           int   *start=&iy0;

           MKL_Complex16* res= (MKL_Complex16*)  malloc(sizeof(MKL_Complex16)  *  convResLength);

           memset( res,  0 ,  sizeof(MKL_Complex16) * ConvResLength );

           int status;

           int   a= vslzConvNewTask1D( task_ptr , VSL_Conv_Mode_Auto , xlength , ylength ,convResLength  );

           int  b = vslzConvSetStart( task  , start);

           status  = vslzConvExec1D( task , x ,1 , y ,1, res , 1 );

           vslconvdeletetask(task_ptr);

           mkl_FreeBuffers();

           return res;

}

0 Kudos
Bernard
Valued Contributor I
516 Views

>>>but when i call mkl_freeBuffer Application crash with access violation exception>>>

Probably heap corruption or double free.

0 Kudos
mmmmm__hamed
Beginner
516 Views

Hi iliyapolak my code exist in above comment . no double free.

only function Result ( res variable ) will be released after use. 

are you have idea?       

0 Kudos
Bernard
Valued Contributor I
516 Views

Without the callstack of crash is very hard to tell what has happend

0 Kudos
Reply