Ignore:
Timestamp:
Nov 2, 2013, 6:33:13 PM (12 years ago)
Author:
[email protected]
Message:

LLVM assertion failures should funnel into WTF's crash handling
https://bugs.webkit.org/show_bug.cgi?id=123682

Source/JavaScriptCore:

Reviewed by Geoffrey Garen.

Inside llvmForJSC, we override assertion-related functions and funnel them
into g_llvmTrapCallback(). We also now register a fatal error handler inside
the library and funnel that into g_llvmTrapCallback, and have
initializeAndGetJSCLLVMAPI() take such a callback as an argument.

Inside JSC, we no longer call LLVMInstallFatalErrorHandler() but instead we
pass WTFLogAlwaysAndCrash() as the trap callback for llvmForJSC.

  • llvm/InitializeLLVM.cpp:

(JSC::initializeLLVM):

  • llvm/InitializeLLVMPOSIX.cpp:

(JSC::initializeLLVMPOSIX):

  • llvm/library/LLVMExports.cpp:

(llvmCrash):
(initializeAndGetJSCLLVMAPI):

  • llvm/library/LLVMOverrides.cpp:

(raise):
(assert_rtn):
(abort):

  • llvm/library/LLVMTrapCallback.h: Added.

Source/WTF:

Reviewed by Geoffrey Garen.

Give JSC some new toys to play with for crash handling.

  • wtf/Assertions.cpp:
  • wtf/Assertions.h:

Tools:

Reviewed by Geoffrey Garen.

Need to disable LLVM's crash overrides so that we can do our own crash overrides.

  • Scripts/configure-llvm:
File:
1 edited

Legend:

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

    r157558 r158509  
    3636static pthread_once_t initializeLLVMOnceKey = PTHREAD_ONCE_INIT;
    3737
    38 static NO_RETURN_DUE_TO_CRASH void llvmCrash(const char* reason)
    39 {
    40     WTFLogAlways("LLVM failure: %s", reason);
    41     CRASH();
    42 }
    43 
    44 static void initializeLLVMOnce()
    45 {
    46     initializeLLVMImpl();
    47    
    48     llvm->InstallFatalErrorHandler(llvmCrash);
    49 }
    50 
    5138void initializeLLVM()
    5239{
    53     pthread_once(&initializeLLVMOnceKey, initializeLLVMOnce);
     40    pthread_once(&initializeLLVMOnceKey, initializeLLVMImpl);
    5441}
    5542
Note: See TracChangeset for help on using the changeset viewer.