Changeset 180622 in webkit for trunk/Source/JavaScriptCore/llvm


Ignore:
Timestamp:
Feb 25, 2015, 2:18:41 AM (10 years ago)
Author:
[email protected]
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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/llvm/InitializeLLVMPOSIX.cpp

    r170525 r180622  
    4949        || Options::showDisassembly();
    5050   
    51     void* library = dlopen(libraryName, RTLD_NOW);
     51    int flags = RTLD_NOW;
     52   
     53#if OS(LINUX)
     54    // We need this to cause our overrides (like __cxa_atexit) to take precedent over the __cxa_atexit that is already
     55    // globally exported. Those overrides are necessary to prevent crashes (our __cxa_atexit turns off LLVM's exit-time
     56    // destruction, which causes exit-time crashes if the concurrent JIT is still running) and to make LLVM assertion
     57    // failures funnel through WebKit's mechanisms. This flag induces behavior that is the default on Darwin. Other OSes
     58    // may need their own flags in place of this.
     59    flags |= RTLD_DEEPBIND;
     60#endif
     61   
     62    void* library = dlopen(libraryName, flags);
    5263    if (!library) {
    5364        if (verbose)
Note: See TracChangeset for help on using the changeset viewer.