diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp index 8f5f1242116f5..084f8012bcc8d 100644 --- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp +++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp @@ -308,7 +308,13 @@ llvm::StringRef ProcessElfCore::GetMainExecutablePath() { } UUID ProcessElfCore::FindModuleUUID(const llvm::StringRef path) { - return m_uuids[std::string(path)]; + // Lookup the UUID for the given path in the map. + // Note that this could be called by multiple threads so make sure + // we access the map in a thread safe way (i.e. don't use operator[]). + auto it = m_uuids.find(std::string(path)); + if (it != m_uuids.end()) + return it->second; + return UUID(); } lldb_private::DynamicLoader *ProcessElfCore::GetDynamicLoader() { diff --git a/lldb/test/API/functionalities/postmortem/netbsd-core/TestNetBSDCore.py b/lldb/test/API/functionalities/postmortem/netbsd-core/TestNetBSDCore.py index 179dbdf88fa8a..ff1ef21e02e31 100644 --- a/lldb/test/API/functionalities/postmortem/netbsd-core/TestNetBSDCore.py +++ b/lldb/test/API/functionalities/postmortem/netbsd-core/TestNetBSDCore.py @@ -117,8 +117,6 @@ def check_backtrace(self, thread, filename, backtrace): ) def do_test(self, filename, pid, region_count): - # Temporary workaround for https://github.com/llvm/llvm-project/issues/159377 - self.runCmd("settings set target.parallel-module-load false") target = self.dbg.CreateTarget(filename) process = target.LoadCore(filename + ".core")