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

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: 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..162e83e60e3941ed61d5cfdc0447485701e07ae3 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,18 @@ bool StartSandboxLinux(const gpu::GPUInfo& gpu_info,
// has really been stopped.
LinuxSandbox::StopThread(watchdog_thread);
}
+
+#if defined(ADDRESS_SANITIZER)
+ LinuxSandbox* linux_sandbox = LinuxSandbox::GetInstance();
+ struct __sanitizer_sandbox_arguments* sanitizer_args =
+ new struct __sanitizer_sandbox_arguments;
+ memset(sanitizer_args, 0, sizeof(*sanitizer_args));
jln (very slow on Chromium) 2014/05/13 01:17:35 *sanitizer_args = {0}; instead?
earthdok 2014/05/14 17:00:26 Done.
+ sanitizer_args->coverage_sandboxed = 1;
+ sanitizer_args->coverage_fd = -1;
+
+ linux_sandbox->SetSanitizerArgs(sanitizer_args);
+#endif
+
// LinuxSandbox::InitializeSandbox() must always be called
// with only one thread.
res = LinuxSandbox::InitializeSandbox();

Powered by Google App Engine
This is Rietveld 408576698