Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Plug a memleak + experience that code out of the MC test for coverage
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 27 Feb 2023 13:54:13 +0000 (14:54 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 27 Feb 2023 13:54:13 +0000 (14:54 +0100)
examples/sthread/pthread-producer-consumer.c
examples/sthread/pthread-producer-consumer.tesh

index cf69840..8073105 100644 (file)
@@ -107,6 +107,7 @@ int main(int argc, char** argv)
   free(pro);
   free(con);
   free(buffer);
+  free(ids);
 
   return 0;
 }
index 0c035f0..a54bed0 100644 (file)
@@ -13,3 +13,11 @@ $ env ASAN_OPTIONS=verify_asan_link_order=0:$ASAN_OPTIONS LD_PRELOAD=${libdir:=.
 > Consumer 1: Remove Item 2 from 0
 > Consumer 2: Remove Item 2 from 1
 > [0.000000] [sthread/INFO] All threads exited. Terminating the simulation.
+
+$ env ASAN_OPTIONS=verify_asan_link_order=0:$ASAN_OPTIONS LD_PRELOAD=${libdir:=.}/libsthread.so ./pthread-producer-consumer -c 2 -C 1 -p 2 -P 1
+> [0.000000] [sthread/INFO] Starting the simulation.
+> Producer 1: Insert Item 0 at 0
+> Consumer 1: Remove Item 0 from 0
+> Producer 1: Insert Item 1 at 1
+> Consumer 1: Remove Item 1 from 1
+> [0.000000] [sthread/INFO] All threads exited. Terminating the simulation.