From 1f39c9582bc6ca4470b202c6b61d477ec3abfce7 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 9 Jul 2025 13:04:51 +0200 Subject: [PATCH] Better report which clone flag are problematic 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 | 1 + coregrind/m_syswrap/syswrap-linux.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index fe56ee526..ce162cb18 100644 --- 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 diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index f2e1c4979..1eaa2621e 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -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()."); } -- 2.47.2