Fix a RCCL initialization to avoid a deadlock (#136)

Also fixes: 

- crash while finalizing rocprof-sys-causal

[ROCm/rocprofiler-systems commit: 26bb604215]
This commit is contained in:
ajanicijamd authored and GitHub committed 2025-03-19 14:48:04 -04:00
1 parent 516c3b11f8
commit df729548d0
7 files changed
+77 -19

No files matched your search

@@ -654,7 +654,16 @@ get_instances()
std::unique_ptr<perf_event>&
get_instance(int64_t _tid)
{
auto& _data = get_instances();
static auto nullInstance = std::unique_ptr<perf_event>{ nullptr };
auto& _data = get_instances();
// If get_instances() returned an empty object, we have to return a reference to a
// static null instance, or else we will crash.
if(_data == nullptr)
{
return nullInstance;
}
if(static_cast<size_t>(_tid) >= _data->size())
{
ROCPROFSYS_SCOPED_THREAD_STATE(ThreadState::Internal);