Bug 1456518 - Shut down the gray mark observers on worker threads, r=jonco
authorSteve Fink <sfink@mozilla.com>
Thu, 17 May 2018 16:20:54 -0700
changeset 419179 dc793fbd9e1a6bc28f09d81fcb24670bf8f6e6bf
parent 419178 5d8bf331bc54cbaaef752a215ee6341a5c30cca2
child 419180 2698e931d8b863e5ab9d2bd5267768f3e9736a7d
push id34029
push usershindli@mozilla.com
push dateMon, 21 May 2018 21:30:22 +0000
treeherdermozilla-central@51f2535c7974 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1456518
milestone62.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 1456518 - Shut down the gray mark observers on worker threads, r=jonco
js/src/shell/js.cpp
js/src/tests/non262/regress/regress-1456518-workergray.js
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -3571,16 +3571,17 @@ WorkerMain(void* arg)
         return;
 
     ShellContext* sc = js_new<ShellContext>(cx);
     if (!sc)
         return;
 
     auto guard = mozilla::MakeScopeExit([&] {
         CancelOffThreadJobsForContext(cx);
+        sc->markObservers.reset();
         JS_DestroyContext(cx);
         js_delete(sc);
         js_delete(input);
     });
 
     sc->isWorker = true;
     JS_SetContextPrivate(cx, sc);
     SetWorkerContextOptions(cx);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/non262/regress/regress-1456518-workergray.js
@@ -0,0 +1,7 @@
+if (typeof 'evalInWorder' == 'function') {
+    evalInWorker(`
+  addMarkObservers([grayRoot(), grayRoot().x, this, Object.create(null)]);
+`);
+}
+
+reportCompare('do not crash', 'do not crash', 'did not crash!');