View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0007627 | GNUnet | revocation service | public | 2023-01-29 22:32 | 2023-06-01 20:26 |
| Reporter | ulfvonbelow | Assigned To | schanzen | ||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | closed | Resolution | fixed | ||
| Product Version | Git master | ||||
| Target Version | 0.19.4 | Fixed in Version | 0.19.4 | ||
| Summary | 0007627: Potential(?) memory leak in gnunet-service-revocation | ||||
| Description | Cleanup is done in shutdown_task. There is space in run() between where the allocation of things that shutdown_task cleans up begins and where shutdown_task is added. This space includes multiple error sites that can cause an early return. They call GNUNET_SCHEDULER_shutdown, but shutdown_task hasn't been added yet. | ||||
| Additional Information | Patch attached. Not an actual problem given these allocations only happen once AFAIK. | ||||
| Tags | memory-leak, patch | ||||
| Attached Files | 0001-REVOCATION-add-shutdown-task-earlier.patch (1,629 bytes)
From 62c6348d94c8571e98df3c86928dd47fe84bb002 Mon Sep 17 00:00:00 2001
From: ulfvonbelow <strilen@tilde.club>
Date: Sun, 29 Jan 2023 05:47:00 -0600
Subject: [PATCH] REVOCATION: add shutdown task earlier.
There are many things that can go wrong and require cleanup before the
shutdown task is currently added. In these cases, GNUNET_SCHEDULER_shutdown is
run and run() is returned from. At present, the only harm in running
shutdown_task earlier would be it unconditionally destroying revocation_map,
so we can add it as soon as that exists.
---
src/revocation/gnunet-service-revocation.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c
index e10771557..2cee70857 100644
--- a/src/revocation/gnunet-service-revocation.c
+++ b/src/revocation/gnunet-service-revocation.c
@@ -899,6 +899,8 @@ run (void *cls,
cfg = c;
revocation_map = GNUNET_CONTAINER_multihashmap_create (16,
GNUNET_NO);
+ GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+ NULL);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_number (cfg,
"REVOCATION",
@@ -1001,8 +1003,6 @@ run (void *cls,
}
GNUNET_free (fn);
- GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
- NULL);
peers = GNUNET_CONTAINER_multipeermap_create (128,
GNUNET_YES);
/* Connect to core service and register core handlers */
--
2.38.1
| ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2023-01-29 22:32 | ulfvonbelow | New Issue | |
| 2023-01-29 22:32 | ulfvonbelow | Tag Attached: memory-leak | |
| 2023-01-29 22:32 | ulfvonbelow | Tag Attached: patch | |
| 2023-01-29 22:32 | ulfvonbelow | File Added: 0001-REVOCATION-add-shutdown-task-earlier.patch | |
| 2023-02-06 05:34 | schanzen | Assigned To | => schanzen |
| 2023-02-06 05:34 | schanzen | Status | new => resolved |
| 2023-02-06 05:34 | schanzen | Resolution | open => fixed |
| 2023-02-06 05:34 | schanzen | Fixed in Version | => 0.19.4 |
| 2023-02-06 05:34 | schanzen | Note Added: 0019761 | |
| 2023-02-06 05:46 | schanzen | Target Version | => 0.19.4 |
| 2023-06-01 20:26 | schanzen | Note Added: 0020243 | |
| 2023-06-01 20:26 | schanzen | Status | resolved => closed |