From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751411AbbCMEu4 (ORCPT ); Fri, 13 Mar 2015 00:50:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42681 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751039AbbCMEuy (ORCPT ); Fri, 13 Mar 2015 00:50:54 -0400 From: Sergio Durigan Junior To: Oleg Nesterov Cc: Andy Lutomirski , Jan Kratochvil , GDB Patches , Pedro Alves , "linux-kernel\@vger.kernel.org" Subject: Re: vvar, gup && coredump Organization: Red Hat Canada References: <20150305154827.GA9441@host1.jankratochvil.net> <87zj7r5fpz.fsf@redhat.com> <20150305205744.GA13165@host1.jankratochvil.net> <20150311200052.GA22654@redhat.com> <20150312143438.GA4338@redhat.com> <20150312165423.GA10073@redhat.com> <20150312173901.GA12225@redhat.com> <874mpqp0sm.fsf@redhat.com> <20150312180229.GA13711@redhat.com> X-URL: http://blog.sergiodj.net Date: Fri, 13 Mar 2015 00:50:48 -0400 Message-ID: <87zj7hlcuv.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, March 12 2015, Oleg Nesterov wrote: >> If I understood this discussion correctly (and thanks Andy and Oleg for, >> *ahem*, dumping all this useful information for us!), GDB will not need >> modifications in the Linux kernel in this area. In fact, my patch >> already implements the "ignore VM_DONTDUMP mappings" part, so we're >> pretty much covered. > > OK, thanks. > > And it seems that we all agree that the kernel should not dump this vma > too. Could you confirm that this is fine from gdb pov just in case? Yes, this is what we expect from the GDB side. This mapping is marked as "dd", so it does not make sense to dump it. While I have you guys, would it be possible for the Linux kernel to include a new flag on VmFlags to uniquely identify an anonymous mapping? Currently, there is no easy way to do that from userspace. My patch implements the following heuristic on GDB: if (pathname == "/dev/zero (deleted)" || pathname == "/SYSV%08x (deleted)" || pathname == " (deleted)" || "Anonymous:" field is > 0 kB || "AnonHugePages:" field is > 0 kB) mapping is anonymous; However, this can be fragile. The Linux kernel checks for i_nlink == 0, but there is no easy way for GDB to check this on userspace (as Jan mentioned, one could look at /proc/PID/map_files/, but they are only accessible by root). That's why I think it would be good to provide this info right away in /proc/PID/smaps... Thanks, -- Sergio GPG key ID: 0x65FC5E36 Please send encrypted e-mail if possible http://sergiodj.net/