Changeset 180649 in webkit


Ignore:
Timestamp:
Feb 25, 2015 4:24:25 PM (9 years ago)
Author:
mark.lam@apple.com
Message:

ASan does not like JSC::MachineThreads::tryCopyOtherThreadStack.
<https://webkit.org/b/141672>

Reviewed by Alexey Proskuryakov.

ASan does not like the fact that we memcpy the stack for GC scans. So,
we're working around this by using our own memcpy (asanUnsafeMemcpy)
implementation that we can tell ASan to ignore.

Source/JavaScriptCore:

  • heap/MachineStackMarker.cpp:

(JSC::asanUnsafeMemcpy):

Tools:

Also removed the previous added directive to ignore *tryCopyOtherThreadStack*
which isn't effective for working around this issue.

  • asan/webkit-asan-ignore.txt:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r180639 r180649  
     12015-02-25  Mark Lam  <mark.lam@apple.com>
     2
     3        ASan does not like JSC::MachineThreads::tryCopyOtherThreadStack.
     4        <https://webkit.org/b/141672>
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        ASan does not like the fact that we memcpy the stack for GC scans.  So,
     9        we're working around this by using our own memcpy (asanUnsafeMemcpy)
     10        implementation that we can tell ASan to ignore.
     11
     12        * heap/MachineStackMarker.cpp:
     13        (JSC::asanUnsafeMemcpy):
     14
    1152015-02-25  Benjamin Poulain  <bpoulain@apple.com>
    216
  • trunk/Source/JavaScriptCore/heap/MachineStackMarker.cpp

    r180602 r180649  
    411411}
    412412
     413#if ASAN_ENABLED
     414void asanUnsafeMemcpy(void* dst, const void* src, size_t);
     415void asanUnsafeMemcpy(void* dst, const void* src, size_t size)
     416{
     417    size_t dstAsSize = reinterpret_cast<size_t>(dst);
     418    size_t srcAsSize = reinterpret_cast<size_t>(src);
     419    RELEASE_ASSERT(dstAsSize == WTF::roundUpToMultipleOf<sizeof(intptr_t)>(dstAsSize));
     420    RELEASE_ASSERT(srcAsSize == WTF::roundUpToMultipleOf<sizeof(intptr_t)>(srcAsSize));
     421    RELEASE_ASSERT(size == WTF::roundUpToMultipleOf<sizeof(intptr_t)>(size));
     422
     423    intptr_t* dstPtr = reinterpret_cast<intptr_t*>(dst);
     424    const intptr_t* srcPtr = reinterpret_cast<const intptr_t*>(src);
     425    size /= sizeof(intptr_t);
     426    while (size--)
     427        *dstPtr++ = *srcPtr++;
     428}
     429   
     430#define memcpy asanUnsafeMemcpy
     431#endif
     432
    413433// This function must not call malloc(), free(), or any other function that might
    414434// acquire a lock. Since 'thread' is suspended, trying to acquire a lock
  • trunk/Tools/ChangeLog

    r180639 r180649  
     12015-02-25  Mark Lam  <mark.lam@apple.com>
     2
     3        ASan does not like JSC::MachineThreads::tryCopyOtherThreadStack.
     4        <https://webkit.org/b/141672>
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        ASan does not like the fact that we memcpy the stack for GC scans.  So,
     9        we're working around this by using our own memcpy (asanUnsafeMemcpy)
     10        implementation that we can tell ASan to ignore.
     11
     12        Also removed the previous added directive to ignore *tryCopyOtherThreadStack*
     13        which isn't effective for working around this issue.
     14
     15        * asan/webkit-asan-ignore.txt:
     16
    1172015-02-25  Benjamin Poulain  <bpoulain@apple.com>
    218
  • trunk/Tools/asan/webkit-asan-ignore.txt

    r180227 r180649  
    55# called from prepareOSREntry(), but there is currently no way to express this in a blacklist.
    66fun:*JSC*Register*jsValue*
    7 fun:*JSC*MachineThreads*tryCopyOtherThreadStack*
     7fun:*asanUnsafeMemcpy*
Note: See TracChangeset for help on using the changeset viewer.