[FIXED] clGetProgramInfo crashes because of wrong size computation

Started by Matthias, July 21, 2013, 19:01:14

Previous topic - Next topic

Matthias

The Java code in CL10 passes:
   param_value.length * PointerBuffer.getPointerSize() as param_value_size

but the C code assumes that this parameter is the number of buffers:
   cl_uchar **param_value_ptr = (cl_uchar **) malloc(param_value_size * sizeof(cl_uchar *));
   while ( _ptr_i < param_value_size ) {
      _ptr_object = (*env)->GetObjectArrayElement(env, param_value, _ptr_i);
      param_value_ptr[_ptr_i++] = (cl_uchar *)(intptr_t)getPointerWrapperAddress(env, _ptr_object);
   }

So this mismatch causes a crash when this function is called - eg through ClProgram.getInfoBinaries

spasi

Thanks for the report. There were multiple bugs to blame actually, everything should be fixed in the next nightly.