Blame SOURCES/valgrind-3.13.0-disable-vgdb-child.patch

b895e3
commit 59af5db9c15d8ea03c1521736fb1f107d66bce08
b895e3
Author: philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9>
b895e3
Date:   Sun Jun 25 20:25:50 2017 +0000
b895e3
b895e3
    After fork, vgdb activity is polled according to the nr of bbs done :
b895e3
    once the nr of bbs done reaches the next vgdb poll, a check for vgdb
b895e3
    activity is done.
b895e3
    This might lead to the activation of gdbserver after fork.
b895e3
    Such poll is however not expected, unless the children is
b895e3
    to be trace.
b895e3
    This spurious poll in the forked child can cause failures
b895e3
    depending on the nr of bbs done before the fork, and the
b895e3
    nr of bbs done between the fork and the exec.
b895e3
    
b895e3
    => disable vgdb poll in the child in the cleanup after fork
b895e3
    in the child, unless the children have to be traced.
b895e3
    
b895e3
    
b895e3
    
b895e3
    git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16454 a5019735-40e9-0310-863c-91ae7b9d1cf9
b895e3
b895e3
diff --git a/coregrind/m_gdbserver/m_gdbserver.c b/coregrind/m_gdbserver/m_gdbserver.c
b895e3
index 87fbce2..648d543 100644
b895e3
--- a/coregrind/m_gdbserver/m_gdbserver.c
b895e3
+++ b/coregrind/m_gdbserver/m_gdbserver.c
b895e3
@@ -646,6 +646,10 @@ static void gdbserver_cleanup_in_child_after_fork(ThreadId me)
b895e3
    
b895e3
    if (VG_(clo_trace_children)) {
b895e3
       VG_(gdbserver_prerun_action) (me);
b895e3
+   } else {
b895e3
+      /* After fork, if we do not trace the children, disable vgdb
b895e3
+         poll to avoid gdbserver being called unexpectedly. */
b895e3
+      VG_(disable_vgdb_poll) ();
b895e3
    }
b895e3
 }
b895e3