From 3623685db80eba4866f13ee413b1b6cf807efa0a Mon Sep 17 00:00:00 2001 From: foreman Date: Fri, 5 Sep 2014 20:58:50 -0400 Subject: [PATCH] P4 to Git Change 1074077 by jatang@jatang-ocl-lnx1 on 2014/09/05 16:58:30 EPR #405458 - clinfo segfaults when ENABLE_CAL_SHUTDOWN=1. For the global variables of: std::map OptionNameMap[2]; std::map NoneSeparatorOptionMap[2]; std::map FOptionMap; std::map MOptionMap; We don't need to call the clear() method explicitly, since the std::map destructor will clean things up (valgrind mem-check doesn't report any leak related to these global variables after this change). Besides, on Linux amd::option::teardown() is called after the global variables' destructors are called, and it will cause segfault. Affected files ... ... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/options.cpp#29 edit [ROCm/clr commit: b9e695d2548b464c701f934a0bb2b108807452f8] --- projects/clr/rocclr/compiler/lib/utils/options.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/projects/clr/rocclr/compiler/lib/utils/options.cpp b/projects/clr/rocclr/compiler/lib/utils/options.cpp index c413566b86..0d1e309202 100644 --- a/projects/clr/rocclr/compiler/lib/utils/options.cpp +++ b/projects/clr/rocclr/compiler/lib/utils/options.cpp @@ -1237,12 +1237,6 @@ init() bool teardown() { - OptionNameMap[0].clear(); - OptionNameMap[1].clear(); - NoneSeparatorOptionMap[0].clear(); - NoneSeparatorOptionMap[1].clear(); - FOptionMap.clear(); - MOptionMap.clear(); return true; }