From 1dc171f490ff98517708e0614cfd46737f16815e Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Sat, 5 Sep 2015 21:27:58 +0000 Subject: [PATCH] Strange segments in /proc/self/maps have been observed in the field. Namely those with a file name and an inode number but without major and minor device numbers. See for instance https://bugs.kde.org/124528#c11 This patch also recognises segments with a file name as FileV segments (which is what valgrind used to do prior to r5818). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15632 --- coregrind/m_aspacemgr/aspacemgr-linux.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 2cc8f8eb0f..7ce3c996ea 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -1519,12 +1519,11 @@ static void read_maps_callback ( Addr addr, SizeT len, UInt prot, seg.hasX = toBool(prot & VKI_PROT_EXEC); seg.hasT = False; - /* Don't use the presence of a filename to decide if a segment in - the initial /proc/self/maps to decide if the segment is an AnonV - or FileV segment as some systems don't report the filename. Use - the device and inode numbers instead. Fixes bug #124528. */ + /* A segment in the initial /proc/self/maps is considered a FileV + segment if either it has a file name associated with it or both its + device and inode numbers are != 0. See bug #124528. */ seg.kind = SkAnonV; - if (dev != 0 && ino != 0) + if (filename || (dev != 0 && ino != 0)) seg.kind = SkFileV; # if defined(VGO_darwin) -- 2.47.2