Explorar o código

[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 %!s(int64=5) %!d(string=hai) anos
pai
achega
57f1bdd47f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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;