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

Also fixes: 

- crash while finalizing rocprof-sys-causal
This commit is contained in:
ajanicijamd
2025-03-19 14:48:04 -04:00
committed by GitHub
parent b621691a53
commit 26bb604215
7 changed files with 77 additions and 19 deletions
+10 -1
View File
@@ -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);