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

Valgrind on Mac 10.10.5 ippInit()

Jacob_B_2
New Contributor I
1,166 Views

Hello,

I have a very basic C program that calls ippInit(). When calling ippInit() valgrind on Mac shows conditional jump or move that is dependent on uninitialised values. Is there more function calls I need to do before calling ippInit()? On Linux the same simple program but using the Linux libraries has no issues reported by valgrind.

PROGRAM

  1 #include "/dirto/ippcp.h"                                         
  2 #include "/dirto/ipp.h"                                           
  3 #include <stdio.h>                                                              
  4                                                                                 
  5 static int Init(void* heap)                                            
  6 {                                                                               
  7     printf("calling ipp init\n");                                               
  8     ippInit(); /* Selects the right optimizations to use */                     
  9                                                                                 
 10     (void)heap;                                                                 
 11     return 0;                                                                   
 12 }                                                                               
 13                                                                                 
 14                                                                                 
 15 int main()                                                                      
 16 {                                                                               
 17     Init(NULL);                                                        
 18                                                                                 
 19     return 0;                                                                   
 20 }  



WARNING BY VALGRIND

calling ipp init
==48583== Conditional jump or move depends on uninitialised value(s)
==48583==    at 0x10001238F: __intel_ssse3_strrchr (in /usr/local/lib/libippcp-9.0.dylib)
==48583==    by 0x100011BB5: DynReload (in /usr/local/lib/libippcp-9.0.dylib)
==48583==    by 0x636F6C2F7273752E: ???
==48583==    by 0x6C2F62696C2F6C60: ???
==48583==    by 0x2D70637070696268: ???
==48583==    by 0x696C79642E302E38: ???
==48583==    by 0x100000061: ??? (in ./a.out)
==48583==    by 0x1FF000000FEFFFF: ???
==48583==    by 0x1: ???
==48583==    by 0x7FFF5FC38597: ??? (in /usr/lib/dyld)
==48583==    by 0x7FFF5FC3FC87: ???
==48583==    by 0x100001007: ??? (in ./a.out)


Regards

0 Kudos
3 Replies
Igor_A_Intel
Employee
1,166 Views

Hello Jacob,

which IPP version do you use? If you use IPP 9.x - you don't need to call ippInit at all both for static and dynamic linking - it is performed automatically. If you use 8.x or earlier - you also don't need to call ippInit for dynamic linked IPP - it is also initialized automatically at dllmain(), and Init is required for static linking only. In your case - dynamic linking - ippInit() function does nothing and doesn't have any internal conditional jumps - therefore I guess you've faced with Valgrind bug or something else.

regards, Igor

0 Kudos
Jacob_B_2
New Contributor I
1,166 Views

Hi Igor,

Thanks for the response. For the version number it is IPP v9.0. Just as a note I do see a performance increase after calling ippInit and when using the function ippcpGetLibraryVersion in my application I see a difference in library version printed out, between calling and not calling ippInit. Not saying that it shouldn't or dosen't try to find the library automatically without calling ippInit, just that I see a difference. Is this user error on my side?

There is the possibility of a Valgrind issue. After the most recent updates in Mac's OS I wouldn't doubt that it is potentially an issue there, especially if my machine was the only one with the Valgrind warning.

Regards,
Jacob

0 Kudos
Chao_Y_Intel
Moderator
1,166 Views

Jacob, 

Can you suggest what is the out put when calling/not calling ippInit()?   For example, what is output of this code: 

 const IppLibraryVersion* lib = ippcpGetLibVersion();
 printf("%s %s %d.%d.%d.%d\n", lib->Name, lib->Version, lib->major, lib->minor, lib->majorBuild, lib- >build); 

Thanks,
Chao

0 Kudos
Reply