From 0c3ff62e3e040105afc8f47a73e42283cd0f0451 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 27 Feb 2023 14:54:13 +0100 Subject: [PATCH] Plug a memleak + experience that code out of the MC test for coverage --- examples/sthread/pthread-producer-consumer.c | 1 + examples/sthread/pthread-producer-consumer.tesh | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/examples/sthread/pthread-producer-consumer.c b/examples/sthread/pthread-producer-consumer.c index cf69840fd8..8073105582 100644 --- a/examples/sthread/pthread-producer-consumer.c +++ b/examples/sthread/pthread-producer-consumer.c @@ -107,6 +107,7 @@ int main(int argc, char** argv) free(pro); free(con); free(buffer); + free(ids); return 0; } diff --git a/examples/sthread/pthread-producer-consumer.tesh b/examples/sthread/pthread-producer-consumer.tesh index 0c035f018e..a54bed01af 100644 --- a/examples/sthread/pthread-producer-consumer.tesh +++ b/examples/sthread/pthread-producer-consumer.tesh @@ -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. -- 2.20.1