From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755365AbbCMPGO (ORCPT ); Fri, 13 Mar 2015 11:06:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46194 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752090AbbCMPGM (ORCPT ); Fri, 13 Mar 2015 11:06:12 -0400 Date: Fri, 13 Mar 2015 16:04:17 +0100 From: Oleg Nesterov To: Sergio Durigan Junior Cc: Andy Lutomirski , Jan Kratochvil , GDB Patches , Pedro Alves , "linux-kernel@vger.kernel.org" Subject: Re: vvar, gup && coredump Message-ID: <20150313150417.GE21603@redhat.com> References: <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> <87zj7hlcuv.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zj7hlcuv.fsf@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/13, Sergio Durigan Junior wrote: > > On Thursday, March 12 2015, Oleg Nesterov wrote: > > > 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. OK. > 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? Note that "anonymous" is not the right term here... I mean it is a bit confusing. Lets discuss this again on debug-list, then we will see if gdb needs more info from kernel. > 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)" And for example, this is not anonymous mapping. But, > mapping is anonymous; I agree, gdb should treat it as anonymous. > However, this can be fragile. The Linux kernel checks for i_nlink == 0, Yes, as we already disccussed, I think the kernel should be changed. It should do something like shmem_mapping() || d_unlinked(), I think. But this needs another discussion on lkml, and in another thread. Oleg.