Commit 51a0e95d by Ian Elliott Committed by Commit Bot

Revert "Suppress memory leaks detected by LSAN"

This reverts commit 2ded93db. Reason for revert: Appears to be breaking the ANGLE roll Original change's description: > Suppress memory leaks detected by LSAN > > In order to be able to land SwANGLE in Chromium, this cl adds > suppressions for memory leaks detected by LSAN. Some of these > should be fixed and some are intentional leaks of global > variables. > > This cl should allow the linux_chromium_asan_rel_ng bot to pass > while using SwANGLE. > > Bug: chromium:972686 > Bug: angleproject:5377 > Change-Id: I50a30e74a7d7c799c9dfa4d307792a56cb9d2017 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2562748 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Alexis Hétu <sugoi@chromium.org> TBR=sugoi@chromium.org,syoussefi@chromium.org,jmadill@chromium.org,sugoi@google.com Change-Id: I2ab53f3ab89143ea639424f108c404f884c3aaf9 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:972686 Bug: angleproject:5377 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2574796Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
parent d6029d65
...@@ -15,10 +15,6 @@ ...@@ -15,10 +15,6 @@
# include "absl/container/flat_hash_map.h" # include "absl/container/flat_hash_map.h"
#endif // defined(ANGLE_USE_ABSEIL) #endif // defined(ANGLE_USE_ABSEIL)
#if defined(ANGLE_WITH_ASAN)
# include <sanitizer/lsan_interface.h>
#endif // defined(ANGLE_WITH_ASAN)
#include <climits> #include <climits>
#include <cstdarg> #include <cstdarg>
#include <cstddef> #include <cstddef>
...@@ -300,12 +296,6 @@ inline bool IsLittleEndian() ...@@ -300,12 +296,6 @@ inline bool IsLittleEndian()
UNREACHABLE(); \ UNREACHABLE(); \
ANGLE_CHECK(context, false, "Unreachable Code.", GL_INVALID_OPERATION) ANGLE_CHECK(context, false, "Unreachable Code.", GL_INVALID_OPERATION)
#if defined(ANGLE_WITH_ASAN)
# define ANGLE_SCOPED_DISABLE_LSAN() __lsan::ScopedDisabler lsanDisabler
#else
# define ANGLE_SCOPED_DISABLE_LSAN()
#endif
// The below inlining code lifted from V8. // The below inlining code lifted from V8.
#if defined(__clang__) || (defined(__GNUC__) && defined(__has_attribute)) #if defined(__clang__) || (defined(__GNUC__) && defined(__has_attribute))
# define ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline)) # define ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline))
......
...@@ -616,15 +616,11 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk, ...@@ -616,15 +616,11 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk,
// Gather global layer properties. // Gather global layer properties.
uint32_t instanceLayerCount = 0; uint32_t instanceLayerCount = 0;
{ ANGLE_VK_TRY(displayVk, vkEnumerateInstanceLayerProperties(&instanceLayerCount, nullptr));
ANGLE_SCOPED_DISABLE_LSAN();
ANGLE_VK_TRY(displayVk, vkEnumerateInstanceLayerProperties(&instanceLayerCount, nullptr));
}
std::vector<VkLayerProperties> instanceLayerProps(instanceLayerCount); std::vector<VkLayerProperties> instanceLayerProps(instanceLayerCount);
if (instanceLayerCount > 0) if (instanceLayerCount > 0)
{ {
ANGLE_SCOPED_DISABLE_LSAN();
ANGLE_VK_TRY(displayVk, vkEnumerateInstanceLayerProperties(&instanceLayerCount, ANGLE_VK_TRY(displayVk, vkEnumerateInstanceLayerProperties(&instanceLayerCount,
instanceLayerProps.data())); instanceLayerProps.data()));
} }
...@@ -646,16 +642,12 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk, ...@@ -646,16 +642,12 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk,
// Enumerate instance extensions that are provided by the vulkan // Enumerate instance extensions that are provided by the vulkan
// implementation and implicit layers. // implementation and implicit layers.
uint32_t instanceExtensionCount = 0; uint32_t instanceExtensionCount = 0;
{ ANGLE_VK_TRY(displayVk,
ANGLE_SCOPED_DISABLE_LSAN(); vkEnumerateInstanceExtensionProperties(nullptr, &instanceExtensionCount, nullptr));
ANGLE_VK_TRY(displayVk, vkEnumerateInstanceExtensionProperties(
nullptr, &instanceExtensionCount, nullptr));
}
std::vector<VkExtensionProperties> instanceExtensionProps(instanceExtensionCount); std::vector<VkExtensionProperties> instanceExtensionProps(instanceExtensionCount);
if (instanceExtensionCount > 0) if (instanceExtensionCount > 0)
{ {
ANGLE_SCOPED_DISABLE_LSAN();
ANGLE_VK_TRY(displayVk, ANGLE_VK_TRY(displayVk,
vkEnumerateInstanceExtensionProperties(nullptr, &instanceExtensionCount, vkEnumerateInstanceExtensionProperties(nullptr, &instanceExtensionCount,
instanceExtensionProps.data())); instanceExtensionProps.data()));
...@@ -666,18 +658,12 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk, ...@@ -666,18 +658,12 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk,
{ {
uint32_t previousExtensionCount = static_cast<uint32_t>(instanceExtensionProps.size()); uint32_t previousExtensionCount = static_cast<uint32_t>(instanceExtensionProps.size());
uint32_t instanceLayerExtensionCount = 0; uint32_t instanceLayerExtensionCount = 0;
{ ANGLE_VK_TRY(displayVk, vkEnumerateInstanceExtensionProperties(
ANGLE_SCOPED_DISABLE_LSAN(); layerName, &instanceLayerExtensionCount, nullptr));
ANGLE_VK_TRY(displayVk, vkEnumerateInstanceExtensionProperties(
layerName, &instanceLayerExtensionCount, nullptr));
}
instanceExtensionProps.resize(previousExtensionCount + instanceLayerExtensionCount); instanceExtensionProps.resize(previousExtensionCount + instanceLayerExtensionCount);
{ ANGLE_VK_TRY(displayVk, vkEnumerateInstanceExtensionProperties(
ANGLE_SCOPED_DISABLE_LSAN(); layerName, &instanceLayerExtensionCount,
ANGLE_VK_TRY(displayVk, vkEnumerateInstanceExtensionProperties( instanceExtensionProps.data() + previousExtensionCount));
layerName, &instanceLayerExtensionCount,
instanceExtensionProps.data() + previousExtensionCount));
}
} }
vk::ExtensionNameList instanceExtensionNames; vk::ExtensionNameList instanceExtensionNames;
...@@ -744,10 +730,7 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk, ...@@ -744,10 +730,7 @@ angle::Result RendererVk::initialize(DisplayVk *displayVk,
else else
{ {
uint32_t apiVersion = VK_API_VERSION_1_0; uint32_t apiVersion = VK_API_VERSION_1_0;
{ ANGLE_VK_TRY(displayVk, enumerateInstanceVersion(&apiVersion));
ANGLE_SCOPED_DISABLE_LSAN();
ANGLE_VK_TRY(displayVk, enumerateInstanceVersion(&apiVersion));
}
if ((VK_VERSION_MAJOR(apiVersion) > 1) || (VK_VERSION_MINOR(apiVersion) >= 1)) if ((VK_VERSION_MAJOR(apiVersion) > 1) || (VK_VERSION_MINOR(apiVersion) >= 1))
{ {
// This is the highest version of core Vulkan functionality that ANGLE uses. // This is the highest version of core Vulkan functionality that ANGLE uses.
......
...@@ -37,11 +37,7 @@ void SetContextToAndroidOpenGLTLSSlot(gl::Context *value) ...@@ -37,11 +37,7 @@ void SetContextToAndroidOpenGLTLSSlot(gl::Context *value)
Thread *AllocateCurrentThread() Thread *AllocateCurrentThread()
{ {
{ gCurrentThread = new Thread();
// Global thread intentionally leaked
ANGLE_SCOPED_DISABLE_LSAN();
gCurrentThread = new Thread();
}
// Initialize fast TLS slot // Initialize fast TLS slot
SetContextToAndroidOpenGLTLSSlot(nullptr); SetContextToAndroidOpenGLTLSSlot(nullptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment