]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge r5990 (fix for: Livelocks entire machine)
authorJulian Seward <jseward@acm.org>
Mon, 28 Aug 2006 12:21:19 +0000 (12:21 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 28 Aug 2006 12:21:19 +0000 (12:21 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_2_BRANCH@6023

memcheck/mc_leakcheck.c

index 3f921cc7dd680cfc641c02710260bf4e1cd4a067..8d30713b378b1eed936be899f38dfae7b5965c03 100644 (file)
@@ -763,6 +763,21 @@ void MC_(do_detect_memory_leaks) (
            continue;
         if (seg->isCH)
            continue;
+
+        /* Don't poke around in device segments as this may cause
+           hangs.  Exclude /dev/zero just in case someone allocated
+           memory by explicitly mapping /dev/zero. */
+        if (seg->kind == SkFileC 
+            && (VKI_S_ISCHR(seg->mode) || VKI_S_ISBLK(seg->mode))) {
+           HChar* dev_name = VG_(am_get_filename)( seg );
+           if (dev_name && 0 == VG_(strcmp)(dev_name, "/dev/zero")) {
+              /* don't skip /dev/zero */
+           } else {
+              /* skip this device mapping */
+              continue;
+           }
+        }
+
         if (0)
            VG_(printf)("ACCEPT %2d  %p %p\n", i, seg->start, seg->end);
         lc_scan_memory(seg->start, seg->end+1 - seg->start);