[asterisk-bugs] [JIRA] (ASTERISK-28609) Memory Leak in frame.c

Ted G (JIRA) noreply at issues.asterisk.org
Fri Nov 8 12:10:32 CST 2019


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=248729#comment-248729 ] 

Ted G commented on ASTERISK-28609:
----------------------------------

First I apologize as I know this is an amateur hour question but its probably been at least a decade since I applied a patch and there are multiple ways I've come across in my searching for how to do it.

Can you tell me the proper way?

Im getting the following in my attempt:

/usr/src/asterisk-16.3.0# patch include/asterisk/frame.h frame-malloc-debug.patch
patching file include/asterisk/frame.h
patching file include/asterisk/frame.h
Hunk #1 FAILED at 43.
Hunk #2 FAILED at 185.
Hunk #3 FAILED at 194.
Hunk #4 FAILED at 205.
Hunk #5 FAILED at 291.
Hunk #6 FAILED at 313.
Hunk #7 FAILED at 736.
7 out of 7 hunks FAILED -- saving rejects to file include/asterisk/frame.h.rej

/usr/src/asterisk-16.3.0# diff include/asterisk/frame.h ../asterisk-16.3.0.bak/include/asterisk/frame.h
563,564c563
< #define ast_frisolate(fr) __ast_frisolate(fr, __FILE__, __LINE__, __PRETTY_FUNCTION__)
< struct ast_frame *__ast_frisolate(struct ast_frame *fr, const char *file, int line, const char *func);
---
> struct ast_frame *ast_frisolate(struct ast_frame *fr);
571,572c570
< #define ast_frdup(fr) __ast_frdup(fr, __FILE__, __LINE__, __PRETTY_FUNCTION__)
< struct ast_frame *__ast_frdup(const struct ast_frame *fr, const char *file, int line, const char *func);
---
> struct ast_frame *ast_frdup(const struct ast_frame *fr);

Is that patched or not? :)


> Memory Leak in frame.c
> ----------------------
>
>                 Key: ASTERISK-28609
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28609
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: General
>    Affects Versions: 16.3.0
>            Reporter: Ted G
>            Assignee: Ted G
>            Severity: Minor
>              Labels: patch
>         Attachments: frame-malloc-debug.patch
>
>
> Hello,
>   There appears to be a memory leak in frame.c.
> Sometimes I received these errors in my logs:
> [Nov  5 21:14:49] WARNING[14918][C-00028a27]: file.c:258 ast_writestream: Translated frame write failed
> I believe this happenes because of some issues between my carrier and the asterisk system and most of the time these errors are not frequent.
> However sometimes these errors are produced thousands of times per day and when that happens the memory usage for asterisk shoots up and never recovers:
> ...
>    1073986 bytes in       5455 allocations in file xmldoc.c
>    1327380 bytes in       1819 allocations in file chan_sip.c
>    1351770 bytes in        840 allocations in file res_rtp_asterisk.c
>    1707720 bytes in        105 allocations in file smoother.c
>    2409853 bytes in        255 allocations in file file.c
>    2988480 bytes in        163 allocations in file bridge_softmix.c
>    7310456 bytes in        633 allocations in file translate.c
>    7434868 bytes in       2773 allocations in file confbridge/conf_config_parser.c
>  899355372 bytes ( 899355372 cache) in    2046261 allocations in file frame.c         <----
>  933339512 bytes allocated (899355372 in caches) in 2102261 selected allocations
>  933339512 bytes in all allocations
>  934016850 bytes in all allocations and deferred free allocations
> axis/root# top -b -n 1 | grep asterisk
> 19727 root      20   0 3353860 1.314g   8256 S 111.8  2.1  16620:19 asterisk     1.3GB :(
> System uptime: 1 week, 3 days, 23 hours, 34 minutes, 42 seconds
> 1 week, 3 days worth of frame write failed error counts:
> mmdd errors
> 1027 2218
> 1028 1426
> 1029 5275
> 1030 2454
> 1031 1612
> 1101 2797
> 1102 1635
> 1103 3278
> 1104 743
> 1105 1117



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



More information about the asterisk-bugs mailing list