From 7e9d69b98fe47e57769563548ede9c911d4ba941 Mon Sep 17 00:00:00 2001 From: Egnal Zurc Date: Wed, 5 Jun 2024 12:16:41 +0200 Subject: [PATCH] Preventing shared sem to be used again The shared semaphore is closed but it's not assigned to null. That's required because the logic check the semaphore status if it's not null. For this reason, we are getting a core some times. --- src/libfaketime.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libfaketime.c b/src/libfaketime.c index 06c6b36..c59c122 100644 --- a/src/libfaketime.c +++ b/src/libfaketime.c @@ -628,6 +628,7 @@ static void ft_cleanup (void) if (shared_sem != NULL) { sem_close(shared_sem); + shared_sem = NULL; } #ifdef FAKE_PTHREAD if (pthread_rwlock_destroy(&monotonic_conds_lock) != 0) {