OpenMPToolsInterface/LLVM-openmp

[OMPD] The LLVM OMPD code may fail to initialize some structure members

Opened this issue · 0 comments

I had seen the following problem (which I think may have been fixed already), but I think that it is worth reporting because the code may have similar problems elsewhere.

What I had seen is that the LLVM OMPD ompd_get_task_in_parallel() failed to initialize the _ompd_task_handle_s::lwt member, which causes a downstream failure in ompd_get_task_function(). I changed the TV memory allocation callback function to zero the block it returns to the library to fix some spurious failures.

After briefly poking around in the sources, I saw that the _ompd_task_handle_s::cuda_kernel_info has the same problem, and there were places where it is not initialized. However, I did not observe any failures as a result.

Suggestion: Since the library is written in C++ and some of the objects do have constructors, consider using "placement new" or adding class-specific operator new/delete methods.