[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Xen-devel] alloca() in linux_privcmd_map_foreign_bulk causing segfault
- To: xen-devel@xxxxxxxxxxxxxxxxxxx
- From: AP <apxeng@xxxxxxxxx>
- Date: Mon, 16 Apr 2012 21:57:09 -0700
- Delivery-date: Tue, 17 Apr 2012 04:57:37 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=UrLbzNC+drIXPfw4LiSgw0yoQQaQR7N1aWDmyxnCE0Y=; b=fan5WZ0C2QirZwH+WMgjsqxwi26QbiAg8tJdbgbrMKJI5EkVWkW3Y1Ep7eKwdFrQJd UZkVNGww1rHOTdcZJyEFb/1EA+ry3h1480gHtEd5OUN4F2szKlly2G8q/JUjrlIUZXm0 OnFWrWrFbRPhRLHmTefQonNcqTgAbUf7C7/S3r7RZIvAFKL8O0y4cuWeFCEsKjv5O/sD E5PPc4m9FNnppZFmwCjqY2yWuTxy6hY9XhLfgpk+dgU2ApR1qGY/4snXHlT91f9L7CuT uv6ZQt+CTxuHsNHVpyGslmanQrdDABSegmYs/qOi6JxUom6yycqBrYtdb6FNqvux+NnV FuhA==
- List-id: Xen developer discussion <xen-devel.lists.xen.org>
On xen-unstable 25164:5bbda657a016, when I try to map in large amounts
of pages (in the GB range) from a guest in to Dom0 using
xc_map_foreign_bulk() I am hitting a segfault.
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bd38d5 in linux_privcmd_map_foreign_bulk (xch=0x605050,
h=<optimized out>, dom=2, prot=<optimized out>, arr=0x7ffff6bf5010,
err=0x7ffff67f4010, num=<optimized out>)
at /usr/include/x86_64-linux-gnu/bits/string3.h:52
52 return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
(gdb) bt
#0 0x00007ffff7bd38d5 in linux_privcmd_map_foreign_bulk (xch=0x605050,
h=<optimized out>, dom=2, prot=<optimized out>, arr=0x7ffff6bf5010,
err=0x7ffff67f4010, num=<optimized out>)
at /usr/include/x86_64-linux-gnu/bits/string3.h:52
#1 0x00007ffff7bd1ffc in xc_map_foreign_bulk (xch=<optimized out>,
dom=<optimized out>, prot=<optimized out>, arr=<optimized out>,
err=<optimized out>, num=<optimized out>) at xc_foreign_memory.c:79
This was working for me with Xen 4.1.2. On comparing
linux_privcmd_map_foreign_bulk() between 4.1.2 and unstable I see that
the pfn array in linux_privcmd_map_foreign_bulk() is being allocated
using alloca() in unstable vs malloc() in 4.1.2. So I am blowing the
stack with the call. If I replace the alloca() with malloc() the call
goes through. What is the way around this? Should I be using
xc_map_foreign_batch() instead, which I think is deprecated? Please
advice...
Thanks,
AP
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel