]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
m_debuginfo/debuginfo.c (di_notify_mmap): Ignore memfd_create mappings
authorMark Wielaard <mark@klomp.org>
Wed, 12 Mar 2025 12:42:12 +0000 (13:42 +0100)
committerMark Wielaard <mark@klomp.org>
Wed, 12 Mar 2025 12:42:19 +0000 (13:42 +0100)
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
coregrind/m_debuginfo/debuginfo.c

index 15686fc5c46ff8dcf45145a3f0f72a383a48c0f5..6c4a6926560ba493e1df58194ac5a1242c92dc29 100644 (file)
@@ -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);