From: Michal Hocko <mhocko@kernel.org>
To: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
linux-next <linux-next@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
sachinp <sachinp@linux.vnet.ibm.com>
Subject: Re: [linux-next][0692229e] next-20171106 fails to boot on Power 7
Date: Tue, 7 Nov 2017 11:28:54 +0100 [thread overview]
Message-ID: <20171107102854.vylrtaodla63kc57@dhcp22.suse.cz> (raw)
In-Reply-To: <1510048229.12079.7.camel@abdul.in.ibm.com>
On Tue 07-11-17 15:20:29, Abdul Haleem wrote:
> Hi,
>
> Today's next kernel fails to boot on Power 7 Machine with below errors
> in boot log messages.
>
> 'Uhuuh, elf segement at 0000000010040000 requested but the memory is
> mapped already'
>
> It was introduced with commit:
>
> 0692229e : fs/binfmt_elf.c: drop MAP_FIXED usage from elf_map
Weird. Clashes shouldn't really happen. Maybe power is doing something
different from other platforms. Could you apply the following debugging
patch to see what is going on there?
---
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 0abc30d681ae..f098aaf60039 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -361,8 +361,28 @@ static unsigned long elf_vm_mmap(struct file *filep, unsigned long addr,
return map_addr;
if ((type & MAP_FIXED) && map_addr != addr) {
- pr_info("Uhuuh, elf segement at %p requested but the memory is mapped already\n",
- (void*)addr);
+ struct mm_struct *mm = current->mm;
+ struct vm_area_struct *vma;
+ pr_info("Uhuuh, elf segement at %p requested but the memory is mapped already, got %p\n",
+ (void*)addr, (void*)map_addr);
+ down_read(&mm->mmap_sem);
+ vma = find_vma(mm, addr);
+ if (vma) {
+ const char *name;
+ pr_info("Clashing vma [%lx, %lx] flags:%lx", vma->vm_start, vma->vm_end, vma->vm_flags);
+ name = arch_vma_name(vma);
+ if (!name) {
+ if (vma->vm_start <= mm->brk &&
+ vma->vm_end >= mm->start_brk)
+ name = "[heap]";
+ else if (vma->vm_start <= vma->vm_mm->start_stack &&
+ vma->vm_end >= vma->vm_mm->start_stack)
+ name = "[stack]";
+ }
+ pr_cont(" name:%s\n", name);
+ } else
+ pr_info("Uhm, no clashing VMA\n");
+ up_read(&mm->mmap_sem);
return -EAGAIN;
}
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2017-11-07 10:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-07 9:50 [linux-next][0692229e] next-20171106 fails to boot on Power 7 Abdul Haleem
2017-11-07 10:28 ` Michal Hocko [this message]
2017-11-07 11:49 ` [0692229e] " Michal Hocko
2017-11-10 12:30 ` [linux-next][0692229e] " Michal Hocko
2017-11-08 13:36 ` Michael Ellerman
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=20171107102854.vylrtaodla63kc57@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=abdhalee@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=sachinp@linux.vnet.ibm.com \
--cc=sfr@canb.auug.org.au \
/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;
as well as URLs for NNTP newsgroup(s).