Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Memory-leaks in ipp dll !!!

abuatnext04
Beginner
743 Views
hi,
i have build a dv transcodeur based on a lib which use IPP Dv decoding function. I work on a sigle-processor IA32 old P4(IPP->W7) and to build i have add all ipp*.lib to my VS'03 project and set W7 in the preprocessing properties of my lib and my exe.

my transcodeur works fine and fast, but in my quality software procedure, i have use boundchecker from Numega to control that my soft was memory-safe. But the Boundcheck report say :

1) Ressource leak in Kernel32 from libguide40.dll
* CloseHandle
* DeleteCriticalSection
2) Memory Leak in dll :
* ippvcw7
* ippiw7
* ippvc
* ippi
* ippcore
* libguide40

i use only the following function :
* ippiInitAllocHuffmanTable_DV_32u
* ippiFreeHuffmanTable_DV_32u
* ippiHuffmanDecodeSegment_DV_8u16s
* ippiQuantInv_DV_16s_C1I
* ippiDCT8x8Inv_16s_C1I
* ippiDCT2x4x8Inv_16s_C1I

have you an idea of the leak's source, where they come from ?
0 Kudos
9 Replies
kevino
Beginner
743 Views
We're seeing the same thing. Thread handle leaks as well as memory. In our application, it looks like two thread handles are leaked for every thread created. Coincidentaly, we use two ipp dlls (signal processing and speech coding).

It appears that every single thread created in the application causes (in our case) two thread handles to be leaked. My guess would be that the IPP dlls are processing DLL_THREAD_ATTACH and duplicating the thread handle at that point, but not closing the handle after DLL_THREAD_DETACH. But that's just a guess.

As a test, I modified the usc_speech_codec example to, just before it exits, create 1000 threads on a thread procedure that immediately exits and then pause for a keystroke before exiting. When it gets to the pause, I viewed the process via Process Explorer from www.sysinternals.com and even though the process only showed a single thread, it showed over 1000 open thread handles.

This bug is particularly nasty because the amount of leakage is totally unrelated to when or how you use ipp. It looks like just being link to ipp and creating and destroying a thread causes one or more handles to leak.
0 Kudos
Vladimir_Dudnik
Employee
743 Views

Hi,

we were able to reproduce your case (with speech sample). The reason of that is difference in libguide40.dll versions, one which comes with IPP in bin folder and another in your Intel Compiler bin folder. I can recommend you two workaround for that isuue.

1)you canmodify your system environment path variable toset path to compiler's bin folder before IPP path.
OR
2) you can place compiler's libguide40.dll at the same folder where your application is located.

Regards,
Vladimir

0 Kudos
kevino
Beginner
743 Views
We are not using the Intel compiler, we're using MS Visual Studio .Net 2003. I've searched the entire system and the only libguide40.dll is file that came with IPP 5.0.

Are you saying that the version of libguide40.dll distributed with IPP 5.0 is wrong or bad and that the correct version is included in the Intel Compiler?
0 Kudos
Vladimir_Dudnik
Employee
743 Views
It seems that libguide40.dll contains some issue related to threading. Can you link your application with IPP static libraries?
Regards,
Vladimir
0 Kudos
geneus
Beginner
743 Views
Have you guys fixed the handle leak? Is there a patch? I'm seeing the same thing as the original poster. Two handles are being leaked every time the ippcore dll loaded.

Here's the stack trace when a handle is created that doesn't get cleaned up (you probably know this already though)

0x03423c4d: libguide40!_kmp_launch_monitor+0x00000215
0x0341776b: libguide40!_kmp_fork_call+0x00002f1b
0x03418e39: libguide40!_kmp_fork_call+0x000045e9
0x03418ad8: libguide40!_kmp_fork_call+0x00004288
0x034196d9: libguide40!_kmpc_invoke_task_func+0x000006ad
0x0341a815: libguide40!_kmpc_begin+0x00000011
0x033f144b: ippcore!ippSetDenormAreZeros+0x0000007b
0x033f3157: ippcore!ippGetLibVersion+0x00000c37
0x7c9011a7: ntdll!LdrInitializeThunk+0x00000029
0x7c918f65: ntdll!CsrNewThread+0x000000eb
0x7c918dde: ntdll!RtlUnicodeStringToInteger+0x0000017d
0x7c90eac7: ntdll!KiUserApcDispatcher+0x00000007
0 Kudos
Vladimir_Dudnik
Employee
743 Views

Hello,

could you please specify OS, version of IPP and compiler you use?

Regards,
Vladimir

0 Kudos
geneus
Beginner
743 Views
Windows XP Professional SP2
IPP 5.0. (ippcore.dll ver. 5.0.11.63, libguide40.dll ver. 4.0.2005.607)
Visual Studio 2005
0 Kudos
Vladimir_Dudnik
Employee
743 Views

Hello,

that's known issue (related to libguide library) which was detected on IPP v5.0 and was fixed in IPP v5.1.

Note, the latest version of IPP is 5.2 beta and IPP 5.2 final release is just coming soon (expected sometime in the end of Q2'07).

Regards,
Vladimir

0 Kudos
kaikailiu
Beginner
743 Views
I got the same trouble with IPP5.3.

As long as VBA creats an object from my COM DLL which was compiled by intel compiler, I see a memory loss almost 22MB immediately when createobject() function being called.
This only happens the first time I create an object from my dll. When I repeatly call my functions, there are no more leaks.

I got this trouble only after I migrate my compiler from VC7.1 to IPP5.3.

Is this due to handle leak? Could you provide me a way to eliminate it? If I cannot solve this problem then I will have to migrate back to VC compiler which I am very unhappy to do.

Thanks.
Kai
0 Kudos
Reply