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

Unified Diff: client/crashpad_info.cc

Issue 1296523003: asan: Don’t pad the CrashpadInfo struct with a red zone (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/crashpad_info.cc
diff --git a/client/crashpad_info.cc b/client/crashpad_info.cc
index 977ea92dd31a8fcd36241b65a98fc478e93c02fc..49221784d91c8f4aa2b88be188099ecae9c3465b 100644
--- a/client/crashpad_info.cc
+++ b/client/crashpad_info.cc
@@ -66,7 +66,17 @@ union Compile_Assert {
// from being dead-stripped.
__attribute__((section(SEG_DATA ",__crashpad_info"),
used,
- visibility("hidden"))) CrashpadInfo g_crashpad_info;
+ visibility("hidden")
+#if __has_feature(address_sanitizer)
+// AddressSanitizer would add a trailing red zone of at least 32 bytes, which
+// would be reflected in the size of the custom section. This confuses
+// MachOImageReader::GetCrashpadInfo(), which finds that the section’s size
+// disagrees with the structure’s size_ field. By specifying an alignment
+// greater than the red zone size, the red zone will be suppressed.
+ ,
+ aligned(64)
+#endif
+ )) CrashpadInfo g_crashpad_info;
#elif defined(OS_WIN)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698