From 57f1bdd47fd7e02eeed8de87654c3d0455e5b3db Mon Sep 17 00:00:00 2001 From: Dmitrii Kuvaiskii Date: Fri, 17 Jan 2020 17:36:07 -0800 Subject: [PATCH] [LibOS] Fix type of checkpoint's total memory size variable Checkpoint's total memory size is stored in shim_cp_store::mem_size field. Previously, this field was of type `int`. When a process allocates more than 2GB of memory and then tries to spawn a child, the checkpoint send/receive fails due to int overflow of mem_size. This commit simply changes mem_size type to `size_t`. This is enough to make the bug go away on e.g. a huge Python app with TensorFlow. --- LibOS/shim/include/shim_checkpoint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibOS/shim/include/shim_checkpoint.h b/LibOS/shim/include/shim_checkpoint.h index ee59196d..9a320a82 100644 --- a/LibOS/shim/include/shim_checkpoint.h +++ b/LibOS/shim/include/shim_checkpoint.h @@ -112,7 +112,7 @@ struct shim_cp_store { /* entries of out-of-band data */ struct shim_mem_entry* last_mem_entry; int mem_nentries; - int mem_size; + size_t mem_size; /* entries of pal handles to send */ struct shim_palhdl_entry* last_palhdl_entry;