Title: [236839] trunk/Source/_javascript_Core
Revision
236839
Author
[email protected]
Date
2018-10-04 12:23:34 -0700 (Thu, 04 Oct 2018)

Log Message

Disable Options::useWebAssemblyFastMemory() on linux if ASAN signal handling is not disabled.
https://bugs.webkit.org/show_bug.cgi?id=190283
<rdar://problem/45015752>

Reviewed by Keith Miller.

* runtime/Options.cpp:
(JSC::Options::initialize):
* wasm/WasmFaultSignalHandler.cpp:
(JSC::Wasm::enableFastMemory):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (236838 => 236839)


--- trunk/Source/_javascript_Core/ChangeLog	2018-10-04 18:27:15 UTC (rev 236838)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-10-04 19:23:34 UTC (rev 236839)
@@ -1,3 +1,16 @@
+2018-10-04  Mark Lam  <[email protected]>
+
+        Disable Options::useWebAssemblyFastMemory() on linux if ASAN signal handling is not disabled.
+        https://bugs.webkit.org/show_bug.cgi?id=190283
+        <rdar://problem/45015752>
+
+        Reviewed by Keith Miller.
+
+        * runtime/Options.cpp:
+        (JSC::Options::initialize):
+        * wasm/WasmFaultSignalHandler.cpp:
+        (JSC::Wasm::enableFastMemory):
+
 2018-10-03  Ross Kirsling  <[email protected]>
 
         [JSC] print() changes CRLF to CRCRLF on Windows

Modified: trunk/Source/_javascript_Core/runtime/Options.cpp (236838 => 236839)


--- trunk/Source/_javascript_Core/runtime/Options.cpp	2018-10-04 18:27:15 UTC (rev 236838)
+++ trunk/Source/_javascript_Core/runtime/Options.cpp	2018-10-04 19:23:34 UTC (rev 236839)
@@ -573,6 +573,18 @@
             if (Options::useMachForExceptions())
                 handleSignalsWithMach();
 #endif
+
+#if ASAN_ENABLED && OS(LINUX) && ENABLE(WEBASSEMBLY_FAST_MEMORY)
+            if (Options::useWebAssemblyFastMemory()) {
+                const char* asanOptions = getenv("ASAN_OPTIONS");
+                bool okToUseWebAssemblyFastMemory = asanOptions
+                    && (strstr(asanOptions, "allow_user_segv_handler=1") || strstr(asanOptions, "handle_segv=0"));
+                if (!okToUseWebAssemblyFastMemory) {
+                    dataLogLn("WARNING: ASAN interferes with JSC signal handlers; useWebAssemblyFastMemory will be disabled.");
+                    Options::useWebAssemblyFastMemory() = false;
+                }
+            }
+#endif
         });
 }
 

Modified: trunk/Source/_javascript_Core/wasm/WasmFaultSignalHandler.cpp (236838 => 236839)


--- trunk/Source/_javascript_Core/wasm/WasmFaultSignalHandler.cpp	2018-10-04 18:27:15 UTC (rev 236838)
+++ trunk/Source/_javascript_Core/wasm/WasmFaultSignalHandler.cpp	2018-10-04 19:23:34 UTC (rev 236839)
@@ -123,12 +123,12 @@
 
 void enableFastMemory()
 {
+#if ENABLE(WEBASSEMBLY_FAST_MEMORY)
     static std::once_flag once;
     std::call_once(once, [] {
         if (!Options::useWebAssemblyFastMemory())
             return;
 
-#if ENABLE(WEBASSEMBLY_FAST_MEMORY)
         installSignalHandler(Signal::BadAccess, [] (Signal signal, SigInfo& sigInfo, PlatformRegisters& ucontext) {
             return trapHandler(signal, sigInfo, ucontext);
         });
@@ -135,8 +135,8 @@
 
         codeLocations.construct();
         fastHandlerInstalled = true;
+    });
 #endif // ENABLE(WEBASSEMBLY_FAST_MEMORY)
-    });
 }
     
 } } // namespace JSC::Wasm
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to