Browse Source

[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.
Dmitrii Kuvaiskii 5 years ago
parent
commit
57f1bdd47f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      LibOS/shim/include/shim_checkpoint.h

+ 1 - 1
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;