Bug 608526 - crash: Assertion failure: thread->data.nativeStackBase == GetNativeStackBase() - r=jimb
authorJulian Seward <jseward@acm.org>
Thu, 25 Nov 2010 08:59:27 -0500
changeset 58216 73caba953b11e7740a8d181c895fbbe244c0c112
parent 58215 7662cf45a33b0f7d1c65eb7225ce5648470eb362
child 58217 8f18f55b6767206f73b8507e4195aa4e8a627e94
push id17206
push userbjacob@mozilla.com
push dateThu, 25 Nov 2010 15:19:01 +0000
treeherdermozilla-central@215657c24079 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimb
bugs608526
milestone2.0b8pre
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 608526 - crash: Assertion failure: thread->data.nativeStackBase == GetNativeStackBase() - r=jimb
js/src/jscntxt.cpp
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -641,17 +641,25 @@ js_CurrentThread(JSRuntime *rt)
             DestroyThread(thread);
             return NULL;
         }
 
         /* Another thread cannot add an entry for the current thread id. */
         JS_ASSERT(p->value == thread);
     }
     JS_ASSERT(thread->id == id);
-    JS_ASSERT(thread->data.nativeStackBase == GetNativeStackBase());
+
+#ifdef DEBUG
+    char* gnsb = (char*) GetNativeStackBase();
+    JS_ASSERT(gnsb + 0      == (char*) thread->data.nativeStackBase ||
+              /* Work around apparent glibc bug; see bug 608526. */
+              gnsb + 0x1000 == (char*) thread->data.nativeStackBase ||
+              gnsb + 0x2000 == (char*) thread->data.nativeStackBase ||
+              gnsb + 0x3000 == (char*) thread->data.nativeStackBase);
+#endif
 
     return thread;
 }
 
 JSBool
 js_InitContextThread(JSContext *cx)
 {
     JSThread *thread = js_CurrentThread(cx->runtime);