View Issue Details

IDProjectCategoryView StatusLast Update
0008817GNUnettransport servicepublic2024-06-08 12:03
Reporterulfvonbelow Assigned Tot3sserakt  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx86-64OSGuix SystemOS Versiona1d711c92e
Product VersionGit master 
Fixed in Version0.21.2 
Summary0008817: Neighbour.natted_addresses isn't destroyed in free_neighbour in gnunet-service-transport
Description&remove_global_addresses, despite its name, does not do any removing from the collection, and only frees the objects it iterates over. The storage for the collection itself is unaffected, and continues holding a bunch of now-invalid pointers.
Steps To Reproduce1. Build gnunet with --enable-sanitizer
2. Start the node with gnunet-arm -s
3. Stop the node after a bit with gnunet-arm -e
4. Observe reported memory leak wherever you've configured transport to log to
Additional InformationPatch attached.
TagsNo tags attached.
Attached Files
0001-TRANSPORT-destroy-neighbour-natted_addresses-when-fr.patch (1,167 bytes)   
From 4ca888160f5fa3ec52e741f770aa32813b1b25b9 Mon Sep 17 00:00:00 2001
From: ulfvonbelow <striness@tilde.club>
Date: Sun, 5 May 2024 23:40:23 -0500
Subject: [PATCH] TRANSPORT: destroy neighbour->natted_addresses when freeing.

The line immediately above this iterates over all of its elements, freeing
each one, but not *removing* each one, plus the map struct itself is still
around.
---
 src/service/transport/gnunet-service-transport.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/service/transport/gnunet-service-transport.c b/src/service/transport/gnunet-service-transport.c
index f4be5e759..311f269b7 100644
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@ -3681,6 +3681,7 @@ free_neighbour (struct Neighbour *neighbour)
   GNUNET_CONTAINER_multipeermap_iterate (neighbour->natted_addresses,
                                          &remove_global_addresses,
                                          NULL);
+  GNUNET_CONTAINER_multipeermap_destroy (neighbour->natted_addresses);
   while (NULL != (dvh = neighbour->dv_head))
   {
     struct DistanceVector *dv = dvh->dv;
-- 
2.41.0

Activities

t3sserakt

2024-05-14 10:44

developer   ~0022415

Fix committed to master branch.

schanzen

2024-06-08 12:03

administrator   ~0022530

0.21.2 released

Related Changesets

gnunet: master 12249bd3

2024-05-14 12:43

t3sserakt


Details Diff
Transport: Fixed 0008817 Affected Issues
0008817
mod - src/service/transport/gnunet-service-transport.c Diff File

Issue History

Date Modified Username Field Change
2024-05-07 06:17 ulfvonbelow New Issue
2024-05-07 06:17 ulfvonbelow File Added: 0001-TRANSPORT-destroy-neighbour-natted_addresses-when-fr.patch
2024-05-13 10:38 schanzen Assigned To => t3sserakt
2024-05-13 10:38 schanzen Status new => assigned
2024-05-14 10:44 t3sserakt Changeset attached => gnunet master 12249bd3
2024-05-14 10:44 t3sserakt Note Added: 0022415
2024-05-14 10:44 t3sserakt Status assigned => resolved
2024-05-14 10:44 t3sserakt Resolution open => fixed
2024-05-14 17:20 schanzen Fixed in Version => 0.21.2
2024-06-08 12:03 schanzen Note Added: 0022530
2024-06-08 12:03 schanzen Status resolved => closed