From: Andi Kleen <andi@firstfloor.org>
To: t cheney <cdmalord@gmail.com>
Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/1] x86: Add process memory layout to coredump file
Date: Sat, 10 Dec 2011 12:02:39 -0800 [thread overview]
Message-ID: <m2y5uknqjk.fsf@firstfloor.org> (raw)
In-Reply-To: <CAE04G=Bu4WnU9SYU9u3-ap6OrBEjWONK8TA8bYBy5OSCCzzDqg@mail.gmail.com> (t. cheney's message of "Sat, 10 Dec 2011 22:37:02 +0800")
t cheney <cdmalord@gmail.com> writes:
> This patch just add memory layout(same as /proc/pid/maps) to
> coredump file. The layout is appended to corenote segment with
> flag NT_MAPS=7.
Seems like a reasonable idea, but can you please share code with
the proc implementation?
It's a bit unusal to have ASCII in a coredump, but I suppose expressing
this in binary would be somewhat ugly.
> + char *buf = notes->data;
> + size_t core_limit = notes->datasz;
> + gate_vma = get_gate_vma(current->mm);
> +
It seems a bit dubious to do this without locking even in a core dump.
> + for (vma = first_vma(current, gate_vma); vma != NULL;
> + vma = next_vma(vma, gate_vma)) {
> + flags = vma->vm_flags;
> + maps_size += len;
> + if (file) {
> + if (maps_size > core_limit)
> + break;
You have a one-off bug here. Also below.
> + DUMP_WRITE(buf, len, foffset);
> + }
-Andi
--
ak@linux.intel.com -- Speaking for myself only
next prev parent reply other threads:[~2011-12-10 20:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-10 14:37 [PATCH 1/1] x86: Add process memory layout to coredump file t cheney
2011-12-10 20:02 ` Andi Kleen [this message]
2011-12-11 12:44 ` t cheney
2011-12-11 13:19 ` t cheney
[not found] ` <CAE04G=D_OzrDRUOj-iVPJY5sNTLMfUKAeikks8TWMYOWvh6HeA@mail.gmail.com>
2011-12-12 21:03 ` Jan Kratochvil
2011-12-18 10:10 ` t cheney
2011-12-14 21:16 ` Al Viro
2011-12-18 12:37 ` t cheney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2y5uknqjk.fsf@firstfloor.org \
--to=andi@firstfloor.org \
--cc=cdmalord@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox