[CRIU] [PATCH] criu/clone: stack size is too small for Android

Andrei Vagin avagin at gmail.com
Sat Apr 20 19:22:28 MSK 2019


Applied, thanks!

On Thu, Apr 18, 2019 at 10:13:58AM +0800, ning.a.zhang at intel.com wrote:
> From: Zhang Ning <ning.a.zhang at intel.com>
> 
> stack for clone is too small, child process will get
> wild pointer, and segfault.
> 
> Error (criu/cr-restore.c:1418): 6082 killed by signal 11: Segmentation fault
> Error (criu/cr-restore.c:2303): Restoring FAILED.
> 
> enlarge stack size to 1024, then no segfault.
> 
> Cc: Chen Hu <hu1.chen at intel.com>
> Signed-off-by: Zhang Ning <ning.a.zhang at intel.com>
> ---
>  criu/clone-noasan.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/criu/clone-noasan.c b/criu/clone-noasan.c
> index c44e7196..5ca280eb 100644
> --- a/criu/clone-noasan.c
> +++ b/criu/clone-noasan.c
> @@ -21,7 +21,7 @@
>   */
>  int clone_noasan(int (*fn)(void *), int flags, void *arg)
>  {
> -	void *stack_ptr = (void *)round_down((unsigned long)&stack_ptr - 256, 16);
> +	void *stack_ptr = (void *)round_down((unsigned long)&stack_ptr - 1024, 16);
>  	BUG_ON((flags & CLONE_VM) && !(flags & CLONE_VFORK));
>  	/*
>  	 * Reserve some bytes for clone() internal needs
> -- 
> 2.20.1
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list