[CRIU] error in VDSO remap
Cyrill Gorcunov
gorcunov at gmail.com
Thu Jul 16 01:11:51 PDT 2015
On Wed, Jul 15, 2015 at 04:28:46PM +0300, Cyrill Gorcunov wrote:
> On Wed, Jul 15, 2015 at 06:48:53AM -0600, Tycho Andersen wrote:
> > Hy Cyrill,
> >
> > On Thu, Jun 04, 2015 at 08:09:00PM +0300, Cyrill Gorcunov wrote:
> > > On Thu, Jun 04, 2015 at 10:59:28AM -0600, Tycho Andersen wrote:
> > > > Hi Cyrill,
> > > > >
> > > > > Could you please give the patch a shot?
> > > >
> > > > No luck, now I'm getting:
> > > >
> > > > http://files.tycho.ws/tmp/vdso-crash-after-patch.tar.gz
> > >
> > > Thank for testing! Will ping if I get some idea.
> >
> > I'm still hitting this, any ideas?
>
> Nope yet. Gonna take a look, thanks for reminder (alsmost forgot about it).
Could you please run the patch attached and once fail happen -- send me
both (images and logs) please.
Cyrill
-------------- next part --------------
>From 0f97e02996f5919f6bac485b2eff5774eb5f0e00 Mon Sep 17 00:00:00 2001
From: Cyrill Gorcunov <gorcunov at openvz.org>
Date: Thu, 16 Jul 2015 11:09:31 +0300
Subject: [PATCH] vdso: debug -- show memory map on remap failure
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
arch/x86/vdso-pie.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/arch/x86/vdso-pie.c b/arch/x86/vdso-pie.c
index 5330531c7623..2d878fabff0b 100644
--- a/arch/x86/vdso-pie.c
+++ b/arch/x86/vdso-pie.c
@@ -248,6 +248,29 @@ err_oob:
return -EFAULT;
}
+static void vdso_debug_show_self_maps(void)
+{
+ int fd = sys_open("/proc/self/maps", O_RDONLY, 0);
+ if (fd >= 0) {
+ char buf[128];
+ long len, i, pid = sys_getpid();
+
+ do {
+ len = sys_read(fd, buf, sizeof(buf));
+ if (len > 0) {
+ for (i = 0; i < len; i++) {
+ if (buf[i] != '\n')
+ continue;
+ buf[i] = '\0';
+ sys_lseek(fd, -(len - i - 1), SEEK_CUR);
+ break;
+ }
+ pr_debug("cm: %i: %s\n", (int)pid, buf);
+ }
+ } while (len > 0);
+ }
+}
+
static int vdso_remap(char *who, unsigned long from, unsigned long to, size_t size)
{
unsigned long addr;
@@ -256,8 +279,8 @@ static int vdso_remap(char *who, unsigned long from, unsigned long to, size_t si
addr = sys_mremap(from, size, size, MREMAP_MAYMOVE | MREMAP_FIXED, to);
if (addr != to) {
- pr_err("Unable to remap %lx -> %lx %lx\n",
- from, to, addr);
+ pr_err("Unable to remap %lx -> %lx %lx\n", from, to, addr);
+ vdso_debug_show_self_maps();
return -1;
}
--
2.4.3
More information about the CRIU
mailing list