Re: [Xen-devel] [PATCH 1/2] libs/gnttab: do not use alloca(3)

2016-08-22 Thread Wei Liu
On Mon, Aug 22, 2016 at 11:24:56AM +0100, David Vrabel wrote: > On 22/08/16 11:10, Wei Liu wrote: > > On Mon, Aug 22, 2016 at 10:46:50AM +0100, David Vrabel wrote: > >> On 17/08/16 15:33, Wei Liu wrote: > >>> The semantics of alloca(3) is not very nice. If the stack overflows, > >>> program behavio

Re: [Xen-devel] [PATCH 1/2] libs/gnttab: do not use alloca(3)

2016-08-22 Thread David Vrabel
On 22/08/16 11:10, Wei Liu wrote: > On Mon, Aug 22, 2016 at 10:46:50AM +0100, David Vrabel wrote: >> On 17/08/16 15:33, Wei Liu wrote: >>> The semantics of alloca(3) is not very nice. If the stack overflows, >>> program behaviour is undefined. >>> >>> Remove the use of alloca(3) and always use mmap

Re: [Xen-devel] [PATCH 1/2] libs/gnttab: do not use alloca(3)

2016-08-22 Thread Wei Liu
On Mon, Aug 22, 2016 at 10:46:50AM +0100, David Vrabel wrote: > On 17/08/16 15:33, Wei Liu wrote: > > The semantics of alloca(3) is not very nice. If the stack overflows, > > program behaviour is undefined. > > > > Remove the use of alloca(3) and always use mmap. > > This is only using alloca() i

Re: [Xen-devel] [PATCH 1/2] libs/gnttab: do not use alloca(3)

2016-08-22 Thread David Vrabel
On 17/08/16 15:33, Wei Liu wrote: > The semantics of alloca(3) is not very nice. If the stack overflows, > program behaviour is undefined. > > Remove the use of alloca(3) and always use mmap. This is only using alloca() if the allocation is < PAGE_SIZE. I think assuming there's this much extra s

[Xen-devel] [PATCH 1/2] libs/gnttab: do not use alloca(3)

2016-08-17 Thread Wei Liu
The semantics of alloca(3) is not very nice. If the stack overflows, program behaviour is undefined. Remove the use of alloca(3) and always use mmap. Signed-off-by: Wei Liu --- tools/libs/gnttab/linux.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/too