Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Unified Diff: content/gpu/gpu_main.cc

Issue 280303002: Add sandbox support for AsanCoverage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address most of jln@'s comments Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/gpu/gpu_main.cc
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 0dac81d459486c2f04a8a862b9afedc92e47e284..28015aa5c5c77bd9849935afa31b3654a664811b 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -51,6 +51,10 @@
#include "content/public/common/sandbox_init.h"
#endif
+#if defined(ADDRESS_SANITIZER)
+#include <sanitizer/asan_interface.h>
+#endif
+
const int kGpuTimeout = 10000;
namespace content {
@@ -426,6 +430,14 @@ bool StartSandboxLinux(const gpu::GPUInfo& gpu_info,
// has really been stopped.
LinuxSandbox::StopThread(watchdog_thread);
}
+
+#if defined(ADDRESS_SANITIZER)
+ LinuxSandbox* linux_sandbox = LinuxSandbox::GetInstance();
+ linux_sandbox->sanitizer_args()->coverage_sandboxed = 1;
+ linux_sandbox->sanitizer_args()->coverage_fd = -1;
+ linux_sandbox->sanitizer_args()->coverage_max_block_size = 0;
+#endif
+
// LinuxSandbox::InitializeSandbox() must always be called
// with only one thread.
res = LinuxSandbox::InitializeSandbox();

Powered by Google App Engine
This is Rietveld 408576698