From 9e4d1c31c7da2c7cd56651b4bb46b842e64e8e9f Mon Sep 17 00:00:00 2001 From: habajpai-amd Date: Tue, 6 Jan 2026 16:39:32 +0530 Subject: [PATCH] fix: prevent static initialization deadlock in thread_data (#2474) * fix: prevent static initialization deadlock in thread_data * update comment --- .../source/lib/rocprof-sys/library/thread_data.hpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/thread_data.hpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/thread_data.hpp index 4a77e8ed99..973ba54a48 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/thread_data.hpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/thread_data.hpp @@ -71,14 +71,8 @@ struct base_thread_data }; grow_functors().emplace_back(_func); - // Immediately sync this container to current peak_num_threads. - // This ensures containers instantiated after threads exceed - // max_supported_threads are properly sized. - auto _current_peak = get_current_peak_num_threads(); - if(_current_peak > static_cast(max_supported_threads)) - { - _func(_current_peak); - } + // NOTE: Do not call _func() here - causes recursive static initialization + // deadlock. Container resizing is handled via grow_functors() in thread_info.cpp. } };