Title: [180622] trunk/Source/_javascript_Core
Revision
180622
Author
[email protected]
Date
2015-02-25 02:18:41 -0800 (Wed, 25 Feb 2015)

Log Message

Need to pass RTLD_DEEPBIND to dlopen() to ensure that our LLVMOverrides take effect on Linux
https://bugs.webkit.org/show_bug.cgi?id=142006

Reviewed by Csaba Osztrogonác.

This fixes hard-to-reproduce concurrency-related crashes when running stress tests with FTL and
concurrent JIT enabled.

* llvm/InitializeLLVMPOSIX.cpp:
(JSC::initializeLLVMPOSIX):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (180621 => 180622)


--- trunk/Source/_javascript_Core/ChangeLog	2015-02-25 10:04:16 UTC (rev 180621)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-02-25 10:18:41 UTC (rev 180622)
@@ -1,3 +1,16 @@
+2015-02-25  Filip Pizlo  <[email protected]>
+
+        Need to pass RTLD_DEEPBIND to dlopen() to ensure that our LLVMOverrides take effect on Linux
+        https://bugs.webkit.org/show_bug.cgi?id=142006
+
+        Reviewed by Csaba Osztrogonác.
+
+        This fixes hard-to-reproduce concurrency-related crashes when running stress tests with FTL and
+        concurrent JIT enabled.
+
+        * llvm/InitializeLLVMPOSIX.cpp:
+        (JSC::initializeLLVMPOSIX):
+
 2015-02-24  Filip Pizlo  <[email protected]>
 
         CMake build of libllvmForJSC.so should limit its export list like the Xcode build does

Modified: trunk/Source/_javascript_Core/llvm/InitializeLLVMPOSIX.cpp (180621 => 180622)


--- trunk/Source/_javascript_Core/llvm/InitializeLLVMPOSIX.cpp	2015-02-25 10:04:16 UTC (rev 180621)
+++ trunk/Source/_javascript_Core/llvm/InitializeLLVMPOSIX.cpp	2015-02-25 10:18:41 UTC (rev 180622)
@@ -48,7 +48,18 @@
         || Options::showDFGDisassembly()
         || Options::showDisassembly();
     
-    void* library = dlopen(libraryName, RTLD_NOW);
+    int flags = RTLD_NOW;
+    
+#if OS(LINUX)
+    // We need this to cause our overrides (like __cxa_atexit) to take precedent over the __cxa_atexit that is already
+    // globally exported. Those overrides are necessary to prevent crashes (our __cxa_atexit turns off LLVM's exit-time
+    // destruction, which causes exit-time crashes if the concurrent JIT is still running) and to make LLVM assertion
+    // failures funnel through WebKit's mechanisms. This flag induces behavior that is the default on Darwin. Other OSes
+    // may need their own flags in place of this.
+    flags |= RTLD_DEEPBIND;
+#endif
+    
+    void* library = dlopen(libraryName, flags);
     if (!library) {
         if (verbose)
             dataLog("Failed to load LLVM library at ", libraryName, ": ", dlerror(), "\n");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to