OSDN Git Service

Merge \"Workaround alloc-dealloc-mismatch error on ASan device boot.\"
authorEvgenii Stepanov <eugenis@google.com>
Thu, 14 Jul 2016 21:50:29 +0000 (21:50 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Thu, 14 Jul 2016 21:50:29 +0000 (21:50 +0000)
am: 7d8f246415

Change-Id: Ic34e6263619b98739f935e0aa05bf50aa7399829

services/surfaceflinger/SurfaceFlinger.cpp

index a10a813..c700116 100644 (file)
 
 EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name);
 
+// Workaround for b/30067360: /proc/self/environ inaccessible in SurfaceFlinger
+// => ASan fails to read ASAN_OPTIONS => alloc-dealloc-mismatch bug is not
+// suppressed and prevents the device from booting.
+#ifndef __has_feature
+#define __has_feature(x) 0
+#endif
+#if __has_feature(address_sanitizer)
+__attribute__((visibility("default")))
+extern "C" const char* __asan_default_options() {
+  return "alloc_dealloc_mismatch=0";
+}
+#endif
+
 namespace android {
 
 // This is the phase offset in nanoseconds of the software vsync event