This is the mail archive of the
mailing list for the GDB project.
Re: vvar, gup && coredump
- From: Oleg Nesterov <oleg at redhat dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: Andy Lutomirski <luto at amacapital dot net>, Jan Kratochvil <jan dot kratochvil at redhat dot com>, GDB Patches <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>, "linux-kernel at vger dot kernel dot org" <linux-kernel at vger dot kernel dot org>
- Date: Fri, 13 Mar 2015 16:04:17 +0100
- Subject: Re: vvar, gup && coredump
- Authentication-results: sourceware.org; auth=none
- References: <20150305205744 dot GA13165 at host1 dot jankratochvil dot net> <20150311200052 dot GA22654 at redhat dot com> <20150312143438 dot GA4338 at redhat dot com> <CALCETrW5rmAHutzm_OwK2LTd_J0XByV3pvWGyW=AmC=v7rLfhQ at mail dot gmail dot com> <20150312165423 dot GA10073 at redhat dot com> <CALCETrUGu5Wc7BbbQ4_tn29JGbyotUJay67EHBEgSa8-bz01Jg at mail dot gmail dot com> <20150312173901 dot GA12225 at redhat dot com> <874mpqp0sm dot fsf at redhat dot com> <20150312180229 dot GA13711 at redhat dot com> <87zj7hlcuv dot fsf at redhat dot com>
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.
> 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 == "<file> (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.