AnsweredAssumed Answered

Memory leak in clGetPlatformIDs of SDK 2.9-1?

Question asked by nibal on Sep 9, 2015
Latest reply on Oct 1, 2015 by dipak

Running my ocl app through Valgrind in Linux I get:

 

==00:00:01:25.265 20441== 1,584 (240 direct, 1,344 indirect) bytes in 1 blocks are definitely lost in loss record 1,091 of 1,220
==00:00:01:25.265 20441== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==00:00:01:25.265 20441== by 0xA427491: ??? (in /usr/lib/libatiadlxx.so)
==00:00:01:25.265 20441== by 0xA435941: ADL2_Main_Control_Refresh (in /usr/lib/libatiadlxx.so)
==00:00:01:25.265 20441== by 0xA435CB1: ADL2_Main_Control_Create (in /usr/lib/libatiadlxx.so)
==00:00:01:25.265 20441== by 0x753C980: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x77A9C52: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x77A03A5: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x77AD5AA: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x7796601: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x74FDD93: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x754F762: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x754F7AE: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x75529C7: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x746E713: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x7471A01: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x7471C75: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x7421D84: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x743F8FD: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x740CA22: clIcdGetPlatformIDsKHR (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libamdocl64.so)
==00:00:01:25.265 20441== by 0x57695B1: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libOpenCL.so.1)
==00:00:01:25.265 20441== by 0x576B985: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libOpenCL.so.1)
==00:00:01:25.265 20441== by 0x597BA8F: pthread_once (pthread_once.S:103)
==00:00:01:25.265 20441== by 0x576B746: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libOpenCL.so.1)
==00:00:01:25.265 20441== by 0x57697A4: ??? (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libOpenCL.so.1)
==00:00:01:25.265 20441== by 0x576AF1F: clGetPlatformIDs (in /opt/AMDAPPSDK-2.9-1/lib/x86_64/libOpenCL.so.1)
==00:00:01:25.265 20441== by 0x410245: getDevices (clutils.c:283)
==00:00:01:25.265 20441== by 0x40DF8F: setupCL (dsp.c:140)

 

There are numerous other warnings about clGetPlatformIDs in valgrind, but are much smaller in scope. Malloc seems to be in libatiadlx.so, can't tell if libatiadlx is responsible to free it or libamdocl64.

Outcomes