• Andreas Haas's avatar
    [wasm] Disable asan for memory_copy_wrapper · eb131dcc
    Andreas Haas authored
    The function {memory_copy_wrapper} is called directly from WebAssembly.
    Before calling {memory_copy_wrapper} we do not reset the
    tread-in-wasm flag. On asan builds on Windows this causes the problem
    observed in the crash report.
    
    My theory is the following: asan on Windows uses exceptions to allocate
    shadow memory lazily. When {memory_copy_wrapper} accesses memory, asan
    causes an exception to allocate shadow memory. This exception is first
    caught by the WebAssembly trap handler, which resets the
    thread-in-wasm flag but then does not handle the exception because it
    cannot find a proper landing pad. Asan then handles the exception and
    continues execution. However. the thread-in-wasm flag is not set
    anymore. A later check of the thread-in-wasm flag then fails.
    
    This CL disables asan for {memory_copy_wrapper} and thereby fixes the
    problem. As indicated above, another solution would be to reset and set
    the thread-in-wasm flag before and after the call to the C function,
    respectively. However, we do not do that for other uses of direct calls
    to C.
    
    R=binji@chromium.org
    
    Bug: chromium:952342
    Change-Id: I2adb2eccf2ac25be58392d21f8f43a04414c7811
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1584326Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#61040}
    eb131dcc
regress-952342.js 721 Bytes