OpenCL ICD loader - segfaults on test

I’m building the ICD loader on ubuntu 12.04: (opencl-icd-

Build looks OK, but when I run it segfaults.

These are the last few lines in the output file (icd_test_app_log.txt):

Value returned: -38
clSetMemObjectDestructorCallback((nil), 0x408457, (nil))
Value returned: -38
clEnqueueUnmapMemObject((nil), (

dmesg shows:

[117527.605377] icd_loader_test[29963]: segfault at 0 ip 00007fe12d9f134d sp 00007fffa32d21a0 error 4 in[7fe12d9ed000+7000]

Any idea what could be causing the problem?

Recompiled with -g and generated the core:

GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Core was generated by `./icd_loader_test'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f2a3bbc634d in clGetExtensionFunctionAddressForPlatform (platform=0x0, function_name=0x40b070 "")
    at /home/steve/icd/icd/icd_dispatch.c:1413
1413        return platform->dispatch->clGetExtensionFunctionAddressForPlatform(