openclc is possibly generating bad bytecode in Xcode5-DP (5A11314m)
| Originator: | gusmueller | ||
| Number: | rdar://14204296 | Date Originated: | Wed, 19 Jun 2013 17:07:25 GMT |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | 5.0 / 5A11314m |
| Classification: | Serious Bug | Reproducible: | Always |
Summary:
When using Xcode5-DP to compile an OpenCL .cl file into bytecode for later calling it using the built GCD stubs, an exception is thrown causing the app to crash.
I think openclc is generating bad bytecode somehow.
Steps to Reproduce:
Run the attached project, or try and call a simple OpenCL function that does something as simple as:
__kernel void doPrintf() {
printf("Hello\n");
}
Via the GCD interface:
dispatch_queue_t queue = gcl_create_dispatch_queue(CL_DEVICE_TYPE_CPU, NULL);
dispatch_sync(queue, ^{
cl_ndrange range = {1, {0}, {2}, {0}};
doPrintf_kernel(&range);
});
Expected Results:
I'd expect the bytecode to load and run
Actual Results:
An exception is thrown:
2013-06-18 16:58:16.253 OpenCLCompileLoadException[29367:303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x10250b358'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff90148b06 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8ed1c3f0 objc_exception_throw + 43
2 CoreFoundation 0x00007fff901df40a -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
3 CoreFoundation 0x00007fff9013702e ___forwarding___ + 414
4 CoreFoundation 0x00007fff90136e18 _CF_forwarding_prep_0 + 232
5 CoreFoundation 0x00007fff900b6bf8 CFDictionaryGetValue + 88
6 OpenCL 0x00007fff8da2a1e1 clCreateProgramWithBinary + 1196
7 OpenCL 0x00007fff8da2a09b clCreateProgramWithBinary + 870
8 OpenCL 0x00007fff8da2c70e clCreateProgramPortableBinaryAPPLE + 574
9 OpenCL 0x00007fff8da23fc6 gclBuildProgramBinaryAPPLE + 400
10 OpenCLCompileLoadException 0x0000000100000ff4 __initBlocks_block_invoke + 52
11 libdispatch.dylib 0x00007fff8ec830b6 _dispatch_client_callout + 8
12 libdispatch.dylib 0x00007fff8ec83041 dispatch_once_f + 50
13 OpenCLCompileLoadException 0x0000000100000f7d initBlocks + 125
14 OpenCLCompileLoadException 0x0000000100000e7d doPrintf_kernel_block_invoke + 61
15 OpenCLCompileLoadException 0x0000000100001182 __49-[OCLBAppDelegate applicationDidFinishLaunching:]_block_invoke + 82
16 libdispatch.dylib 0x00007fff8ec830b6 _dispatch_client_callout + 8
17 libdispatch.dylib 0x00007fff8ec84723 _dispatch_barrier_sync_f_invoke + 39
18 OpenCLCompileLoadException 0x00000001000010f7 -[OCLBAppDelegate applicationDidFinishLaunching:] + 87
....
Regression:
This does not occur with Xcode 4.6.
Notes:
This also affects my application "Acorn".
Sample project: http://gusmueller.com/deleteme/OpenCLCompileLoadException.zip
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!