Bug 1384814 - Add a diagnostic assertion to detect any use of the critical address machinery. r=glandium.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 27 Jul 2017 17:01:09 +1000
changeset 420911 f2cf93fdcb4c1662470b75275b2bf36943ffe264
parent 420910 36bb09c4b28edaefacb7199cd1d73e010753ecb9
child 420912 f2e435cfffbb19a1dc79f934c02405490b26e200
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1384814
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1384814 - Add a diagnostic assertion to detect any use of the critical address machinery. r=glandium. It appears to be unused, but it would be good to have some real-world data to confirm this. A diagnostic assertion is a better choice for this than a telemetry problem because stack-walking is such a low-level operation.
mozglue/misc/StackWalk.cpp
--- a/mozglue/misc/StackWalk.cpp
+++ b/mozglue/misc/StackWalk.cpp
@@ -146,16 +146,21 @@ StackWalkInitCriticalAddress()
   r = pthread_mutex_lock(&mutex);
   MOZ_ASSERT(r == 0);
   struct timespec abstime = { 0, 1 };
   r = pthread_cond_timedwait_relative_np(&cond, &mutex, &abstime);
 
   // restore the previous malloc logger
   malloc_logger = old_malloc_logger;
 
+  // XXX: the critical address machinery appears to have been unnecessary since
+  // Mac OS 10.7 (the minimum version we currently support is 10.9). See bug
+  // 1384814 for details.
+  MOZ_DIAGNOSTIC_ASSERT(!gCriticalAddress.mAddr);
+
   MOZ_ASSERT(r == ETIMEDOUT);
   r = pthread_mutex_unlock(&mutex);
   MOZ_ASSERT(r == 0);
   r = pthread_mutex_destroy(&mutex);
   MOZ_ASSERT(r == 0);
   r = pthread_cond_destroy(&cond);
   MOZ_ASSERT(r == 0);
 }