Issue 8082 - slapd leaks memory - using clang to do static analysis
Summary: slapd leaks memory - using clang to do static analysis
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-18 12:04 UTC by ludovic@hirlimann.net
Modified: 2015-11-30 18:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ludovic@hirlimann.net 2015-03-18 12:04:01 UTC
Full_Name: Ludovic Hirlimann
Version: trunk
OS: Fedora 21
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (2a01:e34:ed45:8a70:eab1:fcff:fede:413)


[ludo@Oulanl openldap]$ ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
./servers/slapd/slapcat 
550969a1 could not stat config file "/usr/local/etc/openldap/slapd.conf": No
such file or directory (2)
slapcat: bad configuration file!

=================================================================
==11688==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 4104 byte(s) in 1 object(s) allocated from:
    #0 0x4b2b50 in calloc (/home/ludo/openldap/servers/slapd/slapd+0x4b2b50)
    #1 0x7b33cd in ber_memcalloc_x
/home/ludo/openldap/libraries/liblber/memory.c:283:9
    #2 0x5703c3 in ch_calloc
/home/ludo/openldap/servers/slapd/ch_malloc.c:104:23
    #3 0x5005e7 in init_config_argv
/home/ludo/openldap/servers/slapd/config.cA1A118:12
    #4 0x505491 in read_config_file
/home/ludo/openldap/servers/slapd/config.c:727:2
    #5 0x4d4771 in read_config
/home/ludo/openldap/servers/slapd/bconfig.c:4485:7
    #6 0x651804 in slap_tool_init
/home/ludo/openldap/servers/slapd/slapcomm.c.c:672:7
    #7 0x64fb63 in slapcat /home/ludo/openldap/servers/slapd/slapcat.c:53:2
    #8 0x4d1b76 in main /home/ludo/openldap/servers/slapd/main.c:411:10
    #9 0x7fa949271fdf in __libc_start_main (/lib64/libc.so.6+0x1ffdf)

SUMMARY: AddressSanitizer: 4104 byte(s) leaked in 1 allocation(s).
Comment 1 Howard Chu 2015-03-18 19:04:13 UTC
ludovic@hirlimann.net wrote:
> Full_Name: Ludovic Hirlimann
> Version: trunk
> OS: Fedora 21
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (2a01:e34:ed45:8a70:eab1:fcff:fede:413)

Thanks for the report but this "leak" is entirely benign, the code is only executed once at startup and leaks don't accumulate during runtime.

We'll fix it but it's far from high priority.
>
> [ludo@Oulanl openldap]$ ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
> ./servers/slapd/slapcat
> 550969a1 could not stat config file "/usr/local/etc/openldap/slapd.conf": No
> such file or directory (2)
> slapcat: bad configuration file!
>
> =================================================================
> ==11688==ERROR: LeakSanitizer: detected memory leaks
>
> Direct leak of 4104 byte(s) in 1 object(s) allocated from:
>      #0 0x4b2b50 in calloc (/home/ludo/openldap/servers/slapd/slapd+0x4b2b50)
>      #1 0x7b33cd in ber_memcalloc_x
> /home/ludo/openldap/libraries/liblber/memory.c:283:9
>      #2 0x5703c3 in ch_calloc
> /home/ludo/openldap/servers/slapd/ch_malloc.c:104:23
>      #3 0x5005e7 in init_config_argv
> /home/ludo/openldap/servers/slapd/config.cA1A118:12
>      #4 0x505491 in read_config_file
> /home/ludo/openldap/servers/slapd/config.c:727:2
>      #5 0x4d4771 in read_config
> /home/ludo/openldap/servers/slapd/bconfig.c:4485:7
>      #6 0x651804 in slap_tool_init
> /home/ludo/openldap/servers/slapd/slapcomm.c.c:672:7
>      #7 0x64fb63 in slapcat /home/ludo/openldap/servers/slapd/slapcat.c:53:2
>      #8 0x4d1b76 in main /home/ludo/openldap/servers/slapd/main.c:411:10
>      #9 0x7fa949271fdf in __libc_start_main (/lib64/libc.so.6+0x1ffdf)
>
> SUMMARY: AddressSanitizer: 4104 byte(s) leaked in 1 allocation(s).
>
>
>


-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 2 Howard Chu 2015-08-19 16:45:27 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 3 Quanah Gibson-Mount 2015-08-21 21:44:52 UTC
changed notes
changed state Test to Release
Comment 4 OpenLDAP project 2015-11-30 18:20:47 UTC
fixed in master
fixed in RE25
fixed in RE24 (2.4.43)
Comment 5 Quanah Gibson-Mount 2015-11-30 18:20:47 UTC
changed notes
changed state Release to Closed