From: Mark Wielaard Date: Wed, 12 Mar 2025 12:42:12 +0000 (+0100) Subject: m_debuginfo/debuginfo.c (di_notify_mmap): Ignore memfd_create mappings X-Git-Tag: VALGRIND_3_25_0~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9616164273be6bd91552683d0543170de27af852;p=thirdparty%2Fvalgrind.git m_debuginfo/debuginfo.c (di_notify_mmap): Ignore memfd_create mappings When valgrind observes a mapping of a memfd_create anonymous file it would generate a warning: WARNING: Serious error when reading debug info When reading debug info from /memfd:mozilla-ipc (deleted): failed to stat64/stat this file All such memfd_create anonymous files are always prefixed with "memfd:" and obviously cannot be stat64/stat. So ignore such warnings. Tested-by: ishikawa@yk.rim.or.jp --- diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 15686fc5c..6c4a69265 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -1196,7 +1196,9 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV, Int use_fd ) if (sr_isError(statres)) { DebugInfo fake_di; Bool quiet = VG_(strstr)(filename, "/var/run/nscd/") != NULL - || VG_(strstr)(filename, "/dev/shm/") != NULL; + || VG_(strstr)(filename, "/dev/shm/") != NULL + || VG_(strncmp)("/memfd:", filename, + VG_(strlen)("/memfd:")) == 0; if (!quiet && VG_(clo_verbosity) > 1) { VG_(memset)(&fake_di, 0, sizeof(fake_di)); fake_di.fsm.filename = ML_(dinfo_strdup)("di.debuginfo.nmm", filename);