From: Julian Seward Date: Mon, 28 Aug 2006 12:21:19 +0000 (+0000) Subject: Merge r5990 (fix for: Livelocks entire machine) X-Git-Tag: svn/VALGRIND_3_2_1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b09970b5d01a7a68ed3a4082043b3640c923425c;p=thirdparty%2Fvalgrind.git Merge r5990 (fix for: Livelocks entire machine) git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_2_BRANCH@6023 --- diff --git a/memcheck/mc_leakcheck.c b/memcheck/mc_leakcheck.c index 3f921cc7dd..8d30713b37 100644 --- a/memcheck/mc_leakcheck.c +++ b/memcheck/mc_leakcheck.c @@ -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);