LWJGL Forum

Archive => Resolved Bugs/RFE => Topic started by: Matthias on July 21, 2013, 19:01:14

Title: [FIXED] clGetProgramInfo crashes because of wrong size computation
Post by: Matthias on July 21, 2013, 19:01:14
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
Title: Re: [BUG] clGetProgramInfo crashes because of wrong size computation
Post by: spasi on July 22, 2013, 17:21:09
Thanks for the report. There were multiple bugs to blame actually, everything should be fixed in the next nightly.