From: dann frazier <dannf@dannf.org>
To: Hugh Dickins <hughd@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
Rik van Riel <riel@redhat.com>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Nick Piggin <npiggin@suse.de>, Mel Gorman <mel@csn.ul.ie>,
Minchan Kim <minchan.kim@gmail.com>,
Ralf Baechle <ralf@linux-mips.org>
Subject: Re: ia64 hang/mca running gdb 'make check'
Date: Thu, 29 Jul 2010 22:34:23 -0600 [thread overview]
Message-ID: <20100730043423.GH20265@lackof.org> (raw)
In-Reply-To: <alpine.DEB.1.00.1007291853450.4466@tigran.mtv.corp.google.com>
On Thu, Jul 29, 2010 at 07:01:56PM -0700, Hugh Dickins wrote:
> On Thu, 29 Jul 2010, dann frazier wrote:
> > On Wed, Jul 28, 2010 at 08:50:18PM -0700, Hugh Dickins wrote:
> > >
> > > Let's note that gdb's gcore is building up its own version of a
> > > coredump, not going through the get_dump_page() code I was wondering
> > > about. If I read gcore correctly (possibly not!), it will be reading
> > > selected areas from /proc/<pid>/mem i.e. using access_process_vm().
> >
> > This appears to be correct. I was able to collect the following
> > stacktrace using INIT:
> >
> > [ 2535.074197] Backtrace of pid 4605 (gdb)
> > [ 2535.074197]
> > [ 2535.074197] Call Trace:
> > [ 2535.074197] [<a00000010000bb00>] ia64_native_leave_kernel+0x0/0x270
> > [ 2535.074197] sp=e000004081c77c40 bsp=e000004081c71018
> > [ 2535.074197] [<a000000100334720>] __copy_user+0x160/0x960
> > [ 2535.074197] sp=e000004081c77e10 bsp=e000004081c71018
> > [ 2535.074197] [<a000000100176b00>] access_process_vm+0x2c0/0x380
> > [ 2535.074197] sp=e000004081c77e10 bsp=e000004081c70f60
>
> Thanks a lot, dann. But it was the [vdso] line in foo's /proc/<pid>/maps
> which you sent me privately, that set me thinking on the right track.
> Here's what I believe is the appropriate patch: please give it a try
> and let us know...
dannf@rx2600:~> gdb foo
GNU gdb (GDB) SUSE (7.0-0.4.16)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "ia64-suse-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/dannf/foo...done.
(gdb) break leaf
Breakpoint 1 at 0x4000000000000401: file foo.c, line 2.
(gdb) run
Starting program: /home/dannf/foo
Breakpoint 1, leaf () at foo.c:2
2 return 0;
(gdb) gcore
Saved corefile core.3952
(gdb)
good work Hugh!
-dann
>
> [PATCH] mm: fix ia64 crash when gcore reads gate area
>
> Debian's ia64 autobuilders have been seeing kernel freeze or reboot
> when running the gdb testsuite (Debian bug 588574): dannf bisected to
> 2.6.32 62eede62dafb4a6633eae7ffbeb34c60dba5e7b1 "mm: ZERO_PAGE without
> PTE_SPECIAL"; and reproduced it with gdb's gcore on a simple target.
>
> I'd missed updating the gate_vma handling in __get_user_pages(): that
> happens to use vm_normal_page() (nowadays failing on the zero page),
> yet reported success even when it failed to get a page - boom when
> access_process_vm() tried to copy that to its intermediate buffer.
>
> Fix this, resisting cleanups: in particular, leave it for now reporting
> success when not asked to get any pages - very probably safe to change,
> but let's not risk it without testing exposure.
>
> Why did ia64 crash with 16kB pages, but succeed with 64kB pages?
> Because setup_gate() pads each 64kB of its gate area with zero pages.
>
> Reported-by: Andreas Barth <aba@not.so.argh.org>
> Bisected-by: dann frazier <dannf@debian.org>
> Signed-off-by: Hugh Dickins <hughd@google.com>
> Cc: stable@kernel.org
> ---
>
> mm/memory.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> --- 2.6.35-rc6/mm/memory.c 2010-05-30 17:58:57.000000000 -0700
> +++ linux/mm/memory.c 2010-07-29 17:57:29.000000000 -0700
> @@ -1394,10 +1394,20 @@ int __get_user_pages(struct task_struct
> return i ? : -EFAULT;
> }
> if (pages) {
> - struct page *page = vm_normal_page(gate_vma, start, *pte);
> + struct page *page;
> +
> + page = vm_normal_page(gate_vma, start, *pte);
> + if (!page) {
> + if (!(gup_flags & FOLL_DUMP) &&
> + is_zero_pfn(pte_pfn(*pte)))
> + page = pte_page(*pte);
> + else {
> + pte_unmap(pte);
> + return i ? : -EFAULT;
> + }
> + }
> pages[i] = page;
> - if (page)
> - get_page(page);
> + get_page(page);
> }
> pte_unmap(pte);
> if (vmas)
>
--
dann frazier
next prev parent reply other threads:[~2010-07-30 4:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-20 17:35 ia64 hang/mca running gdb 'make check' dann frazier
2010-07-21 1:51 ` KAMEZAWA Hiroyuki
2010-07-21 3:06 ` dann frazier
2010-07-21 4:19 ` Hugh Dickins
2010-07-21 12:54 ` KOSAKI Motohiro
2010-07-27 7:19 ` dann frazier
2010-07-27 9:03 ` KAMEZAWA Hiroyuki
2010-07-27 14:43 ` dann frazier
2010-07-29 3:50 ` Hugh Dickins
2010-07-29 19:22 ` dann frazier
2010-07-30 0:41 ` KAMEZAWA Hiroyuki
2010-07-30 2:01 ` Hugh Dickins
2010-07-30 4:34 ` dann frazier [this message]
2010-07-30 17:52 ` Hugh Dickins
2010-07-30 17:58 ` [PATCH] mm: fix ia64 crash when gcore reads gate area Hugh Dickins
2010-07-29 7:38 ` ia64 hang/mca running gdb 'make check' Luming Yu
2010-07-29 7:58 ` KAMEZAWA Hiroyuki
2010-07-29 8:40 ` Luming Yu
2010-07-29 8:44 ` KAMEZAWA Hiroyuki
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=20100730043423.GH20265@lackof.org \
--to=dannf@dannf.org \
--cc=hughd@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mel@csn.ul.ie \
--cc=minchan.kim@gmail.com \
--cc=npiggin@suse.de \
--cc=ralf@linux-mips.org \
--cc=riel@redhat.com \
/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