[asterisk-bugs] [JIRA] (ASTERISK-27974) Leaksanitizer reports libedit2 el_set EL_ADDFN wcsdup leaks

Walter Doekes (JIRA) noreply at issues.asterisk.org
Thu Jul 19 04:04:54 CDT 2018


Walter Doekes created ASTERISK-27974:
----------------------------------------

             Summary: Leaksanitizer reports libedit2 el_set EL_ADDFN wcsdup leaks
                 Key: ASTERISK-27974
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27974
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Core/General
    Affects Versions: 15.5.0, 13.22.0, 16.0.0
            Reporter: Walter Doekes
            Severity: Trivial


When running the asterisk console with the leak sanitizer enabled, you may see this:
{noformat}
hostname*CLI> quit
Disconnected from Asterisk server
Asterisk cleanly ending (0).
Executing last minute cleanups

=================================================================
==22860==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 120 byte(s) in 2 object(s) allocated from:
    #0 0x7f855ee95bcf in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/liblsan.so.0+0xebcf)
    #1 0x7f855cdaa3ee in wcsdup (/usr/lib/x86_64-linux-gnu/libedit.so.2+0x183ee)

SUMMARY: LeakSanitizer: 120 byte(s) leaked in 2 allocation(s).
{noformat}
Those leaks are caused by:
{code}
el_set(el, EL_ADDFN, "ed-complete", "Complete argument", cli_complete);
{code}
But they're not an asterisk problem, but a libedit2-problem.

It is documented in the libedit2 code (the Strdup is a macro around wcsdup):
{code}
        case EL_ADDFN: {          /* const char *, const char *, el_func_t */
...
                // XXX: The two strdup's leak
                ret = map_addfunc(el, Strdup(wargv[0]), Strdup(wargv[1]),
                    func);
                ct_free_argv(wargv);
                break;
{code}

Nothing to fix on the asterisk side. Just reporting it so we have something to point to when the issue is observed.

Other projects have also reported this. For instance:
https://freeswitch.org/jira/si/jira.issueviews:issue-html/FS-11131/FS-11131.html ("\[FS-11131\] Memory Leak with libedit")



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list