ISC DHCP 4.2.0-P2 omapi_listener memory leak

sscdvp at gmail.com sscdvp at gmail.com
Tue Feb 1 07:14:37 UTC 2011


Hi,

Problem:
ISC DHCP 4.2.0-P2 omapi_listener memory leak

Description:
After some tests with DHCP failover when network addresses which failover
try to bind were remaining unavailable for some time,
I found that the memory is leaked on DHCPD process in method omapi_accept().

Affected versions:
I have observed the problem on versions 3.0.7, 3.1-ESV, 4.2.0-P2

How to reproduce:

1. Start DHCP with failover peer configured and with libumem preloaded
# env LD_PRELOAD=libumem.so.1 UMEM_DEBUG=default <PATH_TO_DHCPD_BINARY>

2. Put ifconfig down for interface used to failover purpose.

3. You will see DHCP server logs "address not available".

4. See output
# echo "::findleaks -d " | mdb -p <PID_OF_DHCPD_PROCESS>
Solution:
The trivial patch which fixes that problem is attached as well as MDB
output.

Regards,
Serghei Samsi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-hackers/attachments/20110201/6ec13457/attachment.html>
-------------- next part --------------

# echo "::findleaks -d " | mdb -p 6757
CACHE     LEAKED   BUFCTL CALLER
08131a90       1 081a0ce8 dmalloc+0x12
----------------------------------------------------------------------
   Total       1 buffer, 128 bytes

umem_alloc_128 leak: 1 buffer, 128 bytes
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
         81a0ce8          819fdc0    94cbcb914dbc1                1
                          8131a90                0                0
                 libumem.so.1`umem_cache_alloc_debug+0x16c
                 libumem.so.1`umem_cache_alloc+0xe1
                 libumem.so.1`umem_alloc+0x3f
                 libumem.so.1`malloc+0x23
                 dmalloc+0x12
                 omapi_object_allocate+0x74
                 omapi_connection_allocate+0x1c
                 omapi_listener_connect+0x25
                 omapi_accept+0xd8
                 omapi_one_dispatch+0x6ab
                 dispatch+0x1e
                 main+0xd08
                 _start+0x5d

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dhcp-4.2.0-P2_fix_omapi_listener_memleak.patch
Type: application/octet-stream
Size: 758 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/dhcp-hackers/attachments/20110201/6ec13457/attachment.obj>


More information about the dhcp-hackers mailing list