Module: kamailio Branch: master Commit: 764d5be0c44036bb4b86f841588fb0df3b4bb834 URL: https://github.com/kamailio/kamailio/commit/764d5be0c44036bb4b86f841588fb0df...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2021-04-26T11:22:20+02:00
core/mem: q_malloc - use #else with DBG_QM_MALLOC for debug on freed fragments
---
Modified: src/core/mem/q_malloc.c
---
Diff: https://github.com/kamailio/kamailio/commit/764d5be0c44036bb4b86f841588fb0df... Patch: https://github.com/kamailio/kamailio/commit/764d5be0c44036bb4b86f841588fb0df...
---
diff --git a/src/core/mem/q_malloc.c b/src/core/mem/q_malloc.c index 94f972eae9..fb786ba635 100644 --- a/src/core/mem/q_malloc.c +++ b/src/core/mem/q_malloc.c @@ -509,7 +509,7 @@ void qm_free(void* qmp, void* p)
#ifdef DBG_QM_MALLOC qm_debug_frag(qm, f, file, line); - if (f->u.is_free){ + if (unlikely(f->u.is_free)){ if(likely(cfg_get(core, core_cfg, mem_safety)==0)) { LM_CRIT("BUG: freeing already freed pointer (%p)," " called from %s: %s(%d), first free %s: %s(%ld) - aborting\n", @@ -524,12 +524,13 @@ void qm_free(void* qmp, void* p) } MDBG("freeing frag. %p alloc'ed from %s: %s(%ld)\n", f, f->file, f->func, f->line); -#endif +#else if (unlikely(f->u.is_free)){ LM_INFO("freeing a free fragment (%p/%p) - ignore\n", f, p); return; } +#endif
size=f->size; qm->used-=size;
Daniel-Constantin Mierla writes:
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2021-04-26T11:22:20+02:00
core/mem: q_malloc - use #else with DBG_QM_MALLOC for debug on freed fragments
The large number of log messages are still there, but perhaps this was not supposed to fix the issue.
-- Juha
Apr 26 16:20:32 edge /usr/bin/edge-proxy[7301]: INFO: <core> [core/mem/q_malloc.c:529]: qm_free(): freeing a free fragment (0x7fac5cace480/0x7fac5cace490) - ignore Apr 26 16:20:32 edge /usr/bin/edge-proxy[7301]: INFO: <core> [core/mem/q_malloc.c:529]: qm_free(): freeing a free fragment (0x7fac5cace580/0x7fac5cace590) - ignore Apr 26 16:20:32 edge /usr/bin/edge-proxy[7301]: INFO: <core> [core/mem/q_malloc.c:529]: qm_free(): freeing a free fragment (0x7fac5cace2c0/0x7fac5cace2d0) - ignore
On 26.04.21 15:22, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2021-04-26T11:22:20+02:00
core/mem: q_malloc - use #else with DBG_QM_MALLOC for debug on freed fragments
The large number of log messages are still there, but perhaps this was not supposed to fix the issue.
It was not a fix for it, just something I saw when looking when that log message is printed and I changed because it was not really executed, the condition being already done above inside the if DBG_QM_MALLOC.
Cheers, Daniel
-- Juha
Apr 26 16:20:32 edge /usr/bin/edge-proxy[7301]: INFO: <core> [core/mem/q_malloc.c:529]: qm_free(): freeing a free fragment (0x7fac5cace480/0x7fac5cace490) - ignore Apr 26 16:20:32 edge /usr/bin/edge-proxy[7301]: INFO: <core> [core/mem/q_malloc.c:529]: qm_free(): freeing a free fragment (0x7fac5cace580/0x7fac5cace590) - ignore Apr 26 16:20:32 edge /usr/bin/edge-proxy[7301]: INFO: <core> [core/mem/q_malloc.c:529]: qm_free(): freeing a free fragment (0x7fac5cace2c0/0x7fac5cace2d0) - ignore
Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev