[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] alloca() in linux_privcmd_map_foreign_bulk causing segfault
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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |