From 5b0a687d891e661432dc2a12637a9a956ad68f78 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Sat, 7 Sep 2019 01:38:37 +0000 Subject: [PATCH] Long timeouts for the MacOSX SystemRuntime plugins under ASAN; else quick. In April via r357829, Adrian unified timeouts across lldb and set the default value high so that we wouldn't get timeouts on ASAN bots that were running under load. The library that the MacOSX SystemRuntime has functions that need to take a lock, and if that lock is held already, those functions will never complete; we're seeing the 15 second timeout being hit with inferiors that are doing a lot of enqueuing and dequeuing of libdispatch work items causing this deadlocking behavior. This patch reverts to a very short timeout for these SystemRuntime function calls, given the behavior of this library that they are calling into. When lldb is built with AddressSanitizer enabled, they will use the default 15 second timeout. tl;dr: this reverts to the previous timeouts for these SystemRuntime inf func calls. llvm-svn: 371280 --- lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp | 5 +++++ .../Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp | 4 ++++ lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp | 4 ++++ .../Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp | 4 ++++ 4 files changed, 17 insertions(+) diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp index 3f810ca..b75a581 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp @@ -332,6 +332,11 @@ AppleGetItemInfoHandler::GetItemInfo(Thread &thread, uint64_t item, options.SetUnwindOnError(true); options.SetIgnoreBreakpoints(true); options.SetStopOthers(true); +#if __has_feature(address_sanitizer) + options.SetTimeout(process_sp->GetUtilityExpressionTimeout()); +#else + options.SetTimeout(std::chrono::milliseconds(500)); +#endif options.SetTimeout(process_sp->GetUtilityExpressionTimeout()); options.SetTryAllThreads(false); options.SetIsForUtilityExpr(true); diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp index ef1ea9b..05e34ab 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp @@ -338,7 +338,11 @@ AppleGetPendingItemsHandler::GetPendingItems(Thread &thread, addr_t queue, options.SetUnwindOnError(true); options.SetIgnoreBreakpoints(true); options.SetStopOthers(true); +#if __has_feature(address_sanitizer) options.SetTimeout(process_sp->GetUtilityExpressionTimeout()); +#else + options.SetTimeout(std::chrono::milliseconds(500)); +#endif options.SetTryAllThreads(false); options.SetIsForUtilityExpr(true); thread.CalculateExecutionContext(exe_ctx); diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp index c9df486..7194c40 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp @@ -344,7 +344,11 @@ AppleGetQueuesHandler::GetCurrentQueues(Thread &thread, addr_t page_to_free, options.SetUnwindOnError(true); options.SetIgnoreBreakpoints(true); options.SetStopOthers(true); +#if __has_feature(address_sanitizer) options.SetTimeout(process_sp->GetUtilityExpressionTimeout()); +#else + options.SetTimeout(std::chrono::milliseconds(500)); +#endif options.SetTryAllThreads(false); options.SetIsForUtilityExpr(true); thread.CalculateExecutionContext(exe_ctx); diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp index fd4d21d..3dcfda2 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp @@ -341,7 +341,11 @@ AppleGetThreadItemInfoHandler::GetThreadItemInfo(Thread &thread, options.SetUnwindOnError(true); options.SetIgnoreBreakpoints(true); options.SetStopOthers(true); +#if __has_feature(address_sanitizer) options.SetTimeout(process_sp->GetUtilityExpressionTimeout()); +#else + options.SetTimeout(std::chrono::milliseconds(500)); +#endif options.SetTryAllThreads(false); options.SetIsForUtilityExpr(true); thread.CalculateExecutionContext(exe_ctx); -- 2.7.4