- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I use MKL 9.1.022, and called MKL_FreeBuffers()from destructor C++ class in MS VSNET 2005, whichresulted togeneral exception:
02F6C887 jle _mkl_serv_freebuffers+0C8h (2F6C924h)
02F6C88D mov dword ptr [esp],ebx
02F6C890 mov dword ptr [esp+4],esi
02F6C894 mov dword ptr [esp+8],edi
02F6C898 mov dword ptr [esp+0Ch],ebp
02F6C89C mov edx,1
02F6C8A1 mov ebx,edx
02F6C8A3 mov esi,dword ptr _afxInitAppState+2CAh (5EF3A80h)[ebx*4] 02F6C8AA mov ebp,dword ptr [esi+70h]
Where registers are:
EBPFEEEFEEE
ESI0B837730
EDX00000000
EBX00000003
In the same time this code works fine with MKL 7.2.6.
To have a control over the memory I redirected all memory functions to
my own ones, controlling all allocated and deallocated pointers to
avoid deallocating previously free memory (if pointer in MKL is not set
to NULL after that), which shows up that after calling the MKL_FreeBuffers()
it deallocates 5 buffers, and crashes after 6 one deallocated.
void
* my_malloc(size_t size);void
* my_calloc( size_t num, size_t size );void
* my_realloc( void* memblock, size_t size );void
my_free( void* memblock);
class
CAutoFreeIntelMemory{
public
:std::set
m_pAllocated; CAutoFreeIntelMemory()
{
i_malloc = my_malloc;
i_calloc = my_calloc;
i_realloc = my_realloc;
i_free = my_free;
}
~CAutoFreeIntelMemory();
};
static
CAutoFreeIntelMemory dummyObject;// ----------------------------------------------------------------------------
// my_malloc
// ----------------------------------------------------------------------------
void
* my_malloc(size_t size){
void
* p = malloc( size);dummyObject.m_pAllocated.insert( (DWORD)p);
return p;}
// ----------------------------------------------------------------------------
// my_calloc
// ----------------------------------------------------------------------------
void
* my_calloc( size_t num, size_t size ){
void
* p = calloc( num, size);dummyObject.m_pAllocated.insert( (DWORD)p);
return p;}
// ----------------------------------------------------------------------------
// my_realloc
// ---------------------------------------------------------- ------------------
void
* my_realloc( void* memblock, size_t size ){
void
* p = realloc( memblock, size);dummyObject.m_pAllocated.insert( (DWORD)p);
return p;}
// ----------------------------------------------------------------------------
// my_free
// ----------------------------------------------------------------------------
void
my_free( void* p){
std::set
if ( setIter != dummyObject.m_pAllocated.end())::iterator setIter = dummyObject.m_pAllocated.find((DWORD)p); {
// free( p);dummyObject.m_pAllocated.erase( setIter);
}
}
CAutoFreeIntelMemory::~CAutoFreeIntelMemory()
{
MKL_FreeBuffers();
//Free memory from the intel math library.}
It crashes independently calling of free() function in my_free().
Even if it's commented, as in this my piece of code
// free( p);
it still internally crashes in MKL_FreeBuffers() afterthe same number of calling my_free() function.
It shows that its not GPF, called beacuse of
second deallocation of the previously deallocated memory.
It crashedandin downloaded Beta MKL 10.0.006. The crash depends on number of MKL function calls. Depending of number of the analysis calls MKL_FreeBuffers() may be successful, or crashing. The more the analysis sweep steps, the more buffers MKL allocates, the more probability that its deallocation calls the crash.
Using my memory control functions have shown upthat the memory is not deallocated, but not accessable to free it.
// ----------------------------------------------------------------------------
//Ex itInstance
// ----------------------------------------------------------------------------
int CMyApp::ExitInstance()
{
..................................
FreeIntelMKLMemory();
return __super::ExitInstance();
}
class
CAutoFreeIntelMemory{
public:
void FreeIntelMemory( void);
};
static
CAutoFreeIntelMemory g_cIntelMKLDummyObject;// ----------------------------------------------------------------------------
// FreeIntelMKLMemory
// ----------------------------------------------------------------------------
void
FreeIntelMKLMemory(void){
g_cIntelMKLDummyObject.FreeIntelMemory();
}
void CAutoFreeIntelMemory::FreeIntelMemory(void)
{
MKL_FreeBuffers(); //Free memory from the intel math library.
}
It's fixed the issue, caused by the Intel MKLmulti-trading.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sergey,
To investigate the problem, I need in some details.
Please:
Did you use MKL-ia32 or MKL-em64t?
Did you use static or dynamic MKL? Which MKL libraries were linked?
Is your application dynamic or static? I.e. was MKL called from DLL or not?
Which of MKL functions did you use in your application? BLAS/FFT/...? Functions' names are welcomed.
Thanks,
-Vladimir
MKL library engineering

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