]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Better report which clone flag are problematic
authorMark Wielaard <mark@klomp.org>
Wed, 9 Jul 2025 11:04:51 +0000 (13:04 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 10 Jul 2025 12:21:11 +0000 (14:21 +0200)
Be explict about which combination of CLONE_VM, CLONE_FS, CLONE_FILES
and CLONE_VFORK flags are supported and which combination isn't.

https://bugs.kde.org/show_bug.cgi?id=506795

NEWS
coregrind/m_syswrap/syswrap-linux.c

diff --git a/NEWS b/NEWS
index fe56ee526779b8725d5d92361bb898c631afd77a..ce162cb18ce65bf7231ec04f51087cb19a14e9d2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -52,6 +52,7 @@ are not entered into bugzilla tend to get forgotten about or ignored.
         AMD64_GET_TLSBASE
 505228  Wrap linux specific mseal syscall
 502968  Wrap linux specific syscalls 457 (listmount) and 458 (statmount)
+506795  Better report which clone flags are problematic
 
 To see details of a given bug, visit
   https://bugs.kde.org/show_bug.cgi?id=XXXXXX
index f2e1c4979067c0b2d46cdf3b459c6f6617ec41ab..1eaa2621e6354c39d6b9d17afc5c968336f4095a 100644 (file)
@@ -955,8 +955,17 @@ PRE(sys_clone)
                    "x\n", ARG_FLAGS);
       VG_(message)(Vg_UserMsg, "\n");
       VG_(message)(Vg_UserMsg, "The only supported clone() uses are:\n");
-      VG_(message)(Vg_UserMsg, " - via a threads library (LinuxThreads or NPTL)\n");
-      VG_(message)(Vg_UserMsg, " - via the implementation of fork or vfork\n");
+      VG_(message)(Vg_UserMsg,
+                   " - via a threads library (VM, FS and FILES flags set)\n");
+      VG_(message)(Vg_UserMsg,
+                   " - via the implementation of vfork (VFORK or VFORK and VM flags set)\n");
+      VG_(message)(Vg_UserMsg,
+                   " - via plain fork (no VM, FS, FILES, VFORK flags set)\n");
+      VG_(message)(Vg_UserMsg, " clone call had %s%s%s%sflags set\n",
+                   cloneflags & VKI_CLONE_VM ? "CLONE_VM " : "",
+                   cloneflags & VKI_CLONE_FS ? "CLONE_FS " : "",
+                   cloneflags & VKI_CLONE_FILES ? "CLONE_FILES " : "",
+                   cloneflags & VKI_CLONE_VFORK ? "CLONE_VFORK " : "");
       VG_(unimplemented)
          ("Valgrind does not support general clone().");
    }