]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
After fork, vgdb activity is polled according to the nr of bbs done :
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 25 Jun 2017 20:25:50 +0000 (20:25 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 25 Jun 2017 20:25:50 +0000 (20:25 +0000)
once the nr of bbs done reaches the next vgdb poll, a check for vgdb
activity is done.
This might lead to the activation of gdbserver after fork.
Such poll is however not expected, unless the children is
to be trace.
This spurious poll in the forked child can cause failures
depending on the nr of bbs done before the fork, and the
nr of bbs done between the fork and the exec.

=> disable vgdb poll in the child in the cleanup after fork
in the child, unless the children have to be traced.

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

coregrind/m_gdbserver/m_gdbserver.c

index 87fbce205cc0eadf2cc479e89f5deaeef309c503..648d5436094d68d61759ad7efcc32b437787c626 100644 (file)
@@ -646,6 +646,10 @@ static void gdbserver_cleanup_in_child_after_fork(ThreadId me)
    
    if (VG_(clo_trace_children)) {
       VG_(gdbserver_prerun_action) (me);
+   } else {
+      /* After fork, if we do not trace the children, disable vgdb
+         poll to avoid gdbserver being called unexpectedly. */
+      VG_(disable_vgdb_poll) ();
    }
 }