Bug #200

leaking global TT entries

Added by Linus Lüssing over 6 years ago. Updated about 4 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


There seems to be a memory leak for global translation table entries:

root@Linus-Debian:~# batctl o; batctl tg
[B.A.T.M.A.N. adv 2014.3.0-48-g4383006-dirty, MainIF/MAC: eth1/02:04:64:a4:39:c2 (bat0 BATMAN_IV)]
  Originator      last-seen (#/255)           Nexthop [outgoingIF]:   Potential nexthops ...
No batman nodes in range ...
Globally announced TT entries received via the mesh bat0
       Client         VID  (TTVN)       Originator      (Curr TTVN) (CRC       ) Flags
 + b6:55:75:a2:60:90   -1   (  1) via 02:04:64:a4:39:c1     (  1)   (0x5416bae1) [....]
 + fa:22:c6:ae:eb:7a   -1   (  1) via 02:04:64:a4:39:c1     (  1)   (0xf1e21099) [....]
 + 1a:8b:63:a1:19:f8   -1   (  1) via 02:04:64:a4:39:c1     (  1)   (0x8137a753) [....]
 + f6:04:1d:23:9a:e0   -1   (  1) via 02:04:64:a4:39:c1     (  1)   (0xf182c149) [....]

This not only results in a memory leak for global TT entries but also the associated orig_node, now in invisible zombie state. Furthermore the leaking orig_node results in potentially bogus multicast counters (resulting in the multicast optimizations not always activating when they should).

The attached debug patch, basically decreasing intervals, makes it easy to reproduce the issue with the following two nodes setup:

[eth0--A--eth1] ~ [eth0--B]

(so eth1, the secondary interface, of node A is connected to eth0, the primary interface, of node B)

Running the following command on node A results in a new leak on node B about every two seconds:

while true; do
    batctl if del eth1; batctl if del eth0
    sleep 2
    batctl if add eth0; batctl if add eth1
    sleep `echo 0.$((10*$RANDOM/32767))$((10*$RANDOM/32767))$((10*$RANDOM/32767))`

The log output of node B (batman+route+tt) is attached as well.


0001-TT-memory-leak-debug-patch.patch (8.79 KB) 0001-TT-memory-leak-debug-patch.patch Linus Lüssing, 12/13/2014 08:02 AM
node-B-TT-leak.log (128 KB) node-B-TT-leak.log Linus Lüssing, 12/13/2014 08:02 AM



Updated by Linus Lüssing over 6 years ago

  • Description updated (diff)

Updated by Marek Lindner about 6 years ago

I do believe we have merged your patch ? Can we close the ticket ?


Updated by Linus Lüssing about 6 years ago

Yes, can be closed, got fixed with 2014.4.0. Thanks :)!


Updated by Marek Lindner about 6 years ago

  • Status changed from New to Closed

Updated by Sven Eckelmann about 4 years ago

  • Target version set to 2014.4.0

Also available in: Atom PDF