Changeset 236839 in webkit


Ignore:
Timestamp:
Oct 4, 2018 12:23:34 PM (6 years ago)
Author:
mark.lam@apple.com
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):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r236827 r236839  
     12018-10-04  Mark Lam  <mark.lam@apple.com>
     2
     3        Disable Options::useWebAssemblyFastMemory() on linux if ASAN signal handling is not disabled.
     4        https://bugs.webkit.org/show_bug.cgi?id=190283
     5        <rdar://problem/45015752>
     6
     7        Reviewed by Keith Miller.
     8
     9        * runtime/Options.cpp:
     10        (JSC::Options::initialize):
     11        * wasm/WasmFaultSignalHandler.cpp:
     12        (JSC::Wasm::enableFastMemory):
     13
    1142018-10-03  Ross Kirsling  <ross.kirsling@sony.com>
    215
  • trunk/Source/JavaScriptCore/runtime/Options.cpp

    r236538 r236839  
    573573            if (Options::useMachForExceptions())
    574574                handleSignalsWithMach();
     575#endif
     576
     577#if ASAN_ENABLED && OS(LINUX) && ENABLE(WEBASSEMBLY_FAST_MEMORY)
     578            if (Options::useWebAssemblyFastMemory()) {
     579                const char* asanOptions = getenv("ASAN_OPTIONS");
     580                bool okToUseWebAssemblyFastMemory = asanOptions
     581                    && (strstr(asanOptions, "allow_user_segv_handler=1") || strstr(asanOptions, "handle_segv=0"));
     582                if (!okToUseWebAssemblyFastMemory) {
     583                    dataLogLn("WARNING: ASAN interferes with JSC signal handlers; useWebAssemblyFastMemory will be disabled.");
     584                    Options::useWebAssemblyFastMemory() = false;
     585                }
     586            }
    575587#endif
    576588        });
  • trunk/Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp

    r234528 r236839  
    124124void enableFastMemory()
    125125{
     126#if ENABLE(WEBASSEMBLY_FAST_MEMORY)
    126127    static std::once_flag once;
    127128    std::call_once(once, [] {
     
    129130            return;
    130131
    131 #if ENABLE(WEBASSEMBLY_FAST_MEMORY)
    132132        installSignalHandler(Signal::BadAccess, [] (Signal signal, SigInfo& sigInfo, PlatformRegisters& ucontext) {
    133133            return trapHandler(signal, sigInfo, ucontext);
     
    136136        codeLocations.construct();
    137137        fastHandlerInstalled = true;
     138    });
    138139#endif // ENABLE(WEBASSEMBLY_FAST_MEMORY)
    139     });
    140140}
    141141   
Note: See TracChangeset for help on using the changeset viewer.