diff options
author | Richard Mudgett <rmudgett@digium.com> | 2018-02-27 15:40:18 -0600 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2018-02-28 11:41:30 -0600 |
commit | 1a36a452bd92eba702170ac2fe9bf2d83fbfaa98 (patch) | |
tree | 3ac4af64b514aa7b5ceaf27aa9267d79c183f066 /res/res_rtp_asterisk.c | |
parent | 53ed437db3f37d941538ec1bf0ff96c422c7bef5 (diff) |
pjproject: Add cache_pools debugging option.
The pool cache gets in the way of finding use after free errors of memory
pool contents. Tools like valgrind and MALLOC_DEBUG don't know when a
pool is released because it gets put into the cache instead of being
freed.
* Added the "cache_pools" option to pjproject.conf. Disabling the option
helps track down pool content mismanagement when using valgrind or
MALLOC_DEBUG. The cache gets in the way of determining if the pool
contents are used after free and who freed it.
To disable the pool caching simply disable the cache_pools option in
pjproject.conf and restart Asterisk.
Sample pjproject.conf setting:
[startup]
cache_pools=no
* Made current users of the caching pool factory initialization and
destruction calls call common routines to create and destroy cached pools.
ASTERISK-27704
Change-Id: I64d5befbaeed2532f93aa027a51eb52347d2b828
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r-- | res/res_rtp_asterisk.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index d3273b463..b53b38ad7 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -71,6 +71,9 @@ #include "asterisk/smoother.h" #include "asterisk/uuid.h" #include "asterisk/test.h" +#ifdef HAVE_PJPROJECT +#include "asterisk/res_pjproject.h" +#endif #define MAX_TIMESTAMP_SKEW 640 @@ -7376,7 +7379,7 @@ static void rtp_terminate_pjproject(void) pj_thread_destroy(timer_thread); } - pj_caching_pool_destroy(&cachingpool); + ast_pjproject_caching_pool_destroy(&cachingpool); pj_shutdown(); } #endif @@ -7401,7 +7404,7 @@ static int load_module(void) return AST_MODULE_LOAD_DECLINE; } - pj_caching_pool_init(&cachingpool, &pj_pool_factory_default_policy, 0); + ast_pjproject_caching_pool_init(&cachingpool, &pj_pool_factory_default_policy, 0); pool = pj_pool_create(&cachingpool.factory, "timer", 512, 512, NULL); |