Revision: 20400
Author:   [email protected]
Date:     Tue Apr  1 12:48:35 2014 UTC
Log: MSan does not understand inline asm. This change preinitializes cpuid
results, and disables the use of stos.

Random mmap() addresses conflict with sanitizer memory layout.

[email protected]

Review URL: https://codereview.chromium.org/212723003

Patch from Evgeniy Stepanov <[email protected]>.
http://code.google.com/p/v8/source/detail?r=20400

Modified:
 /branches/bleeding_edge/src/atomicops_internals_x86_gcc.cc
 /branches/bleeding_edge/src/platform-posix.cc
 /branches/bleeding_edge/src/v8utils.h

=======================================
--- /branches/bleeding_edge/src/atomicops_internals_x86_gcc.cc Fri Jul 5 09:52:11 2013 UTC +++ /branches/bleeding_edge/src/atomicops_internals_x86_gcc.cc Tue Apr 1 12:48:35 2014 UTC
@@ -77,10 +77,10 @@
 void AtomicOps_Internalx86CPUFeaturesInit() {
   using v8::internal::AtomicOps_Internalx86CPUFeatures;

-  uint32_t eax;
-  uint32_t ebx;
-  uint32_t ecx;
-  uint32_t edx;
+  uint32_t eax = 0;
+  uint32_t ebx = 0;
+  uint32_t ecx = 0;
+  uint32_t edx = 0;

   // Get vendor string (issue CPUID with eax = 0)
   cpuid(eax, ebx, ecx, edx, 0);
=======================================
--- /branches/bleeding_edge/src/platform-posix.cc Fri Mar 21 09:28:26 2014 UTC +++ /branches/bleeding_edge/src/platform-posix.cc Tue Apr 1 12:48:35 2014 UTC
@@ -214,6 +214,11 @@
   // See http://code.google.com/p/nativeclient/issues/3341
   return NULL;
 #endif
+#if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) || \
+    defined(THREAD_SANITIZER)
+  // Dynamic tools do not support custom mmap addresses.
+  return NULL;
+#endif
   Isolate* isolate = Isolate::UncheckedCurrent();
   // Note that the current isolate isn't set up in a call path via
// CpuFeatures::Probe. We don't care about randomization in this case because
=======================================
--- /branches/bleeding_edge/src/v8utils.h       Fri Dec  6 16:23:49 2013 UTC
+++ /branches/bleeding_edge/src/v8utils.h       Tue Apr  1 12:48:35 2014 UTC
@@ -215,6 +215,11 @@
 #undef STOS
 #endif

+#if defined(MEMORY_SANITIZER)
+  // MemorySanitizer does not understand inline assembly.
+#undef STOS
+#endif
+
 #if defined(__GNUC__) && defined(STOS)
   asm volatile(
       "cld;"

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to