]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a fix equivalent to r10751 for amd64-darwin: Resync after
authorJulian Seward <jseward@acm.org>
Thu, 22 Jul 2010 08:47:19 +0000 (08:47 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 22 Jul 2010 08:47:19 +0000 (08:47 +0000)
{wq,p}thread_hijack rather than merely doing a check.  Also, some
whitespace changes that make it easier to diff by eye relative to the
x86-darwin versions.  "Fixes" the problem reported at
https://bugs.kde.org/show_bug.cgi?id=205241#c74

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11223

coregrind/m_syswrap/syswrap-amd64-darwin.c

index b84f42057bd582e1fa88ca8fead2a5240de98c96..27422e51d157bb4a33bb9bc53f0df30ccb3f13b7 100644 (file)
@@ -331,12 +331,13 @@ void pthread_hijack(Addr self, Addr kport, Addr func, Addr func_arg,
             VKI_PROT_READ|VKI_PROT_WRITE, VKI_MAP_PRIVATE, -1, 0);
       // guard page
       ML_(notify_core_and_tool_of_mmap)(
-            stack-VKI_PAGE_SIZE, VKI_PAGE_SIZE, 0, VKI_MAP_PRIVATE, -1, 0);
+            stack-VKI_PAGE_SIZE, VKI_PAGE_SIZE,
+            0, VKI_MAP_PRIVATE, -1, 0);
    } else {
       // client allocated stack
       find_stack_segment(tst->tid, sp);
    }
-   VG_(am_do_sync_check)("after", "pthread_hijack", 0);
+   ML_(sync_mappings)("after", "pthread_hijack", 0);
 
    // Tell parent thread's POST(sys_bsdthread_create) that we're done 
    // initializing registers and mapping memory.
@@ -446,7 +447,6 @@ void wqthread_hijack(Addr self, Addr kport, Addr stackaddr, Addr workitem,
       ML_(wqthread_continue_NORETURN)(tst->tid);
    } 
    else {
-
       // Record thread's stack and Mach port and pthread struct
       tst->os_state.pthread = self;
       tst->os_state.lwpid = kport;
@@ -470,9 +470,10 @@ void wqthread_hijack(Addr self, Addr kport, Addr stackaddr, Addr workitem,
       // guard page
       // GrP fixme ban_mem_stack!
       ML_(notify_core_and_tool_of_mmap)(
-            stack-VKI_PAGE_SIZE, VKI_PAGE_SIZE, 0, VKI_MAP_PRIVATE, -1, 0);
+            stack-VKI_PAGE_SIZE, VKI_PAGE_SIZE,
+            0, VKI_MAP_PRIVATE, -1, 0);
 
-      VG_(am_do_sync_check)("after", "wqthread_hijack", 0);
+      ML_(sync_mappings)("after", "wqthread_hijack", 0);
 
       // Go!
       /* Same comments as the 'release' in the then-clause.