diff options
| -rw-r--r-- | lldb/source/Host/macosx/Host.mm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lldb/source/Host/macosx/Host.mm b/lldb/source/Host/macosx/Host.mm index adef97f5a24..4bd78df1b51 100644 --- a/lldb/source/Host/macosx/Host.mm +++ b/lldb/source/Host/macosx/Host.mm @@ -325,7 +325,13 @@ ThreadNameAccessor (bool get, lldb::pid_t pid, lldb::tid_t tid, const char *name Mutex::Locker locker(&g_mutex); typedef std::map<uint64_t, std::string> thread_name_map; - static thread_name_map g_thread_names; + // rdar://problem/8153284 + // Fixed a crasher where during shutdown, loggings attempted to access the + // thread name but the static map instance had already been destructed. + // Another approach is to introduce a static guard object which monitors its + // own destruction and raises a flag, but this incurs more overhead. + static thread_name_map *g_thread_names_ptr = new thread_name_map(); + thread_name_map &g_thread_names = *g_thread_names_ptr; if (get) { |

