Title: [180734] releases/WebKitGTK/webkit-2.8
Revision
180734
Author
[email protected]
Date
2015-02-27 03:51:12 -0800 (Fri, 27 Feb 2015)

Log Message

Merge r180649 - 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/_javascript_Core:

* 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:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/ChangeLog (180733 => 180734)


--- releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/ChangeLog	2015-02-27 08:03:24 UTC (rev 180733)
+++ releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/ChangeLog	2015-02-27 11:51:12 UTC (rev 180734)
@@ -1,3 +1,17 @@
+2015-02-25  Mark Lam  <[email protected]>
+
+        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.
+
+        * heap/MachineStackMarker.cpp:
+        (JSC::asanUnsafeMemcpy):
+
 2015-02-15  Sam Weinig  <[email protected]>
 
         Add experimental <attachment> element support

Modified: releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/heap/MachineStackMarker.cpp (180733 => 180734)


--- releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/heap/MachineStackMarker.cpp	2015-02-27 08:03:24 UTC (rev 180733)
+++ releases/WebKitGTK/webkit-2.8/Source/_javascript_Core/heap/MachineStackMarker.cpp	2015-02-27 11:51:12 UTC (rev 180734)
@@ -443,6 +443,26 @@
     return std::make_pair(begin, static_cast<char*>(end) - static_cast<char*>(begin));
 }
 
+#if ASAN_ENABLED
+void asanUnsafeMemcpy(void* dst, const void* src, size_t);
+void asanUnsafeMemcpy(void* dst, const void* src, size_t size)
+{
+    size_t dstAsSize = reinterpret_cast<size_t>(dst);
+    size_t srcAsSize = reinterpret_cast<size_t>(src);
+    RELEASE_ASSERT(dstAsSize == WTF::roundUpToMultipleOf<sizeof(intptr_t)>(dstAsSize));
+    RELEASE_ASSERT(srcAsSize == WTF::roundUpToMultipleOf<sizeof(intptr_t)>(srcAsSize));
+    RELEASE_ASSERT(size == WTF::roundUpToMultipleOf<sizeof(intptr_t)>(size));
+
+    intptr_t* dstPtr = reinterpret_cast<intptr_t*>(dst);
+    const intptr_t* srcPtr = reinterpret_cast<const intptr_t*>(src);
+    size /= sizeof(intptr_t);
+    while (size--)
+        *dstPtr++ = *srcPtr++;
+}
+    
+#define memcpy asanUnsafeMemcpy
+#endif
+
 // This function must not call malloc(), free(), or any other function that might
 // acquire a lock. Since 'thread' is suspended, trying to acquire a lock
 // will deadlock if 'thread' holds that lock.

Modified: releases/WebKitGTK/webkit-2.8/Tools/ChangeLog (180733 => 180734)


--- releases/WebKitGTK/webkit-2.8/Tools/ChangeLog	2015-02-27 08:03:24 UTC (rev 180733)
+++ releases/WebKitGTK/webkit-2.8/Tools/ChangeLog	2015-02-27 11:51:12 UTC (rev 180734)
@@ -1,3 +1,28 @@
+2015-02-25  Mark Lam  <[email protected]>
+
+        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.
+
+        Also removed the previous added directive to ignore *tryCopyOtherThreadStack*
+        which isn't effective for working around this issue. 
+
+        * asan/webkit-asan-ignore.txt:
+
+2015-02-17  Dana Burkart  <[email protected]>
+
+        ASan does not like JSC::MachineThreads::tryCopyOtherThreadStack
+        https://bugs.webkit.org/show_bug.cgi?id=141672
+
+        Reviewed by David Kilzer.
+
+        * asan/webkit-asan-ignore.txt:
+
 2015-02-17  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Fix GTK+ make distcheck.

Modified: releases/WebKitGTK/webkit-2.8/Tools/asan/webkit-asan-ignore.txt (180733 => 180734)


--- releases/WebKitGTK/webkit-2.8/Tools/asan/webkit-asan-ignore.txt	2015-02-27 08:03:24 UTC (rev 180733)
+++ releases/WebKitGTK/webkit-2.8/Tools/asan/webkit-asan-ignore.txt	2015-02-27 11:51:12 UTC (rev 180734)
@@ -4,3 +4,4 @@
 # FIXME (rdar://problem/19379214): Register::jsValue() only needs to be blacklisted when
 # called from prepareOSREntry(), but there is currently no way to express this in a blacklist.
 fun:*JSC*Register*jsValue*
+fun:*asanUnsafeMemcpy*
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to