martinkr

Valgrind memcheck complains about ACML cpuid function

Discussion created by martinkr on Nov 18, 2009
Latest reply on Nov 19, 2009 by jim.conyngham@amd.com

Dear all,

I'm using the ACML library on an Intel Core2 processor under Ubuntu linux. When using valgrind's memcheck (valgrind version 3.5) to debug my programs, I get a bunch of warning from ACML's acmlcpuid function. While this does not affect the program's functionality, I makes it difficult for me to find actual errors hidden in the middle of hundreds of warnings. Anyone else having the same problem? If it  is a bug in the ACML library (and not some shortcoming of valgrind), I would be very happy if it could be fixed for the next ACML release.

Here is the error message (just call the sgemm function):

==1940== Conditional jump or move depends on uninitialised value(s)
==1940==    at 0x4E9CF55: IdentifyCPUTYPE (in /usr/local/lib/libacml.so)
==1940==    by 0x4E9F7E1: acmlcpuid (in /usr/local/lib/libacml.so)
==1940==    by 0x554DF81: sgemmp_ (in /usr/local/lib/libacml.so)
==1940==    by 0x554F782: sgemm_ (in /usr/local/lib/libacml.so)
==1940==    by 0x554D662: sgemm (in /usr/local/lib/libacml.so)
==1940==    by 0x40081E: main (test.cpp:20)
==1940==
==1940== Conditional jump or move depends on uninitialised value(s)
==1940==    at 0x4C26470: strncmp (mc_replace_strmem.c:386)
==1940==    by 0x4E9D09D: IdentifyCPUTYPE (in /usr/local/lib/libacml.so)
==1940==    by 0x4E9F7E1: acmlcpuid (in /usr/local/lib/libacml.so)
==1940==    by 0x554DF81: sgemmp_ (in /usr/local/lib/libacml.so)
==1940==    by 0x554F782: sgemm_ (in /usr/local/lib/libacml.so)
==1940==    by 0x554D662: sgemm (in /usr/local/lib/libacml.so)
==1940==    by 0x40081E: main (test.cpp:20)

...

==1940== Conditional jump or move depends on uninitialised value(s)
==1940==    at 0x4E9B2AC: IdentifyIntelCpu (in /usr/local/lib/libacml.so)
==1940==    by 0x4E9D100: IdentifyCPUTYPE (in /usr/local/lib/libacml.so)
==1940==    by 0x4E9F7E1: acmlcpuid (in /usr/local/lib/libacml.so)
==1940==    by 0x554DF81: sgemmp_ (in /usr/local/lib/libacml.so)
==1940==    by 0x554F782: sgemm_ (in /usr/local/lib/libacml.so)
==1940==    by 0x554D662: sgemm (in /usr/local/lib/libacml.so)
==1940==    by 0x40081E: main (test.cpp:20)


Best,

Martin

#include <acml.h> int main () { float * a_mat = new float[100], * b_mat = new float[100], * c_mat = new float[100]; for (unsigned int i=0; i<100; ++i) { a_mat[i] = 1.; b_mat[i] = (float)i/(i+10); c_mat[i] = 0.; } int N = 10; float fone = 1., fzero = 0.; char notrans = 'n'; sgemm (notrans, notrans, N, N, N, fone, a_mat, N, b_mat, N, fzero, c_mat, N); delete [] a_mat; delete [] b_mat; delete [] c_mat; return 0; }

Outcomes