upon further tracing it looks like crash happens in action.c
MODF_RVE_PARAM_FREE when calling pkg_free((dst)[i+2].u.data);
-----Original Message-----
From: denis(a)dilvest.com [mailto:denis@dilvest.com]
Sent: Wednesday, June 17, 2015 1:25 PM
To: 'sr-dev(a)lists.sip-router.org'
Subject: Kamailio crashes when using replace_body_atonce from Textops
Hi,
Need some help resolving Kamailio crash.
Kamailio version 4.1 on Centos (uname -r "Linux 2.6.18-164.11.1.el5")
The issue:
I want to replace text in the message body using replace_body_atonce from
TextOps module
Works fine when called like:
replace_body_atonce("123456789","000");
Works fine when called like:
$var(replacewith)="000";
replace_body_atonce("123456789",$var(replacewith));
However, Kamailio crashes when called like
$var(findwhat)="123456789";
$var(replacewith)="000";
replace_body_atonce($var(findwhat),$var(replacewith));
The following is in the log
Jun 17 16:21:08 tms /usr/local/sbin/kamailio[18614]: ERROR: textops
[textops.c:570]: do_replace_body_f(): exit Jun 17 16:21:08 tms
/usr/local/sbin/kamailio[18614]: : <core> [mem/q_malloc.c:454]: qm_free():
BUG: qm_free: bad pointer 0xc0c0c0c0 (out of memory block!) called from
<core>: action.c: do_action(1164) - aborting Jun 17 16:21:08 tms
/usr/local/sbin/kamailio[18612]: ALERT: <core> [main.c:778]: handle_sigs():
child process 18614 exited by a signal 6 Jun 17 16:21:08 tms
/usr/local/sbin/kamailio[18612]: ALERT: <core> [main.c:781]: handle_sigs():
core was not generated
For some reason no core dump is generated ( i have tried "ulimit -c
unlimited" and "echo "1" > /proc/sys/kernel/core_uses_pid"). However, I
added log entry right before replace_body_atonce returns and I do see that
replace_body_atonce completes and returns but then crashes.
I can easily reproduce the issue. Please let me know if you have some
suggestion to try (even in the code as I can recompile it).
Thanks,
Denis
Hi,
Need some help resolving Kamailio crash.
Kamailio version 4.1 on Centos (uname -r "Linux 2.6.18-164.11.1.el5")
The issue:
I want to replace text in the message body using replace_body_atonce from
TextOps module
Works fine when called like:
replace_body_atonce("123456789","000");
Works fine when called like:
$var(replacewith)="000";
replace_body_atonce("123456789",$var(replacewith));
However, Kamailio crashes when called like
$var(findwhat)="123456789";
$var(replacewith)="000";
replace_body_atonce($var(findwhat),$var(replacewith));
The following is in the log
Jun 17 16:21:08 tms /usr/local/sbin/kamailio[18614]: ERROR: textops
[textops.c:570]: do_replace_body_f(): exit
Jun 17 16:21:08 tms /usr/local/sbin/kamailio[18614]: : <core>
[mem/q_malloc.c:454]: qm_free(): BUG: qm_free: bad pointer 0xc0c0c0c0 (out
of memory block!) called from <core>: action.c: do_action(1164) - aborting
Jun 17 16:21:08 tms /usr/local/sbin/kamailio[18612]: ALERT: <core>
[main.c:778]: handle_sigs(): child process 18614 exited by a signal 6
Jun 17 16:21:08 tms /usr/local/sbin/kamailio[18612]: ALERT: <core>
[main.c:781]: handle_sigs(): core was not generated
For some reason no core dump is generated ( i have tried "ulimit -c
unlimited" and "echo "1" > /proc/sys/kernel/core_uses_pid"). However, I
added log entry right before replace_body_atonce returns and I do see that
replace_body_atonce completes and returns but then crashes.
I can easily reproduce the issue. Please let me know if you have some
suggestion to try (even in the code as I can recompile it).
Thanks,
Denis
Hello,
This pull request adds 2 features.
--Prioritize the trusted records (highest to lowest priority)
--Match from-uri AND request-uri, if either is blank only one is matched.
Please review the pull request and let me know if any other changes are needed.
Thank you.
Emmanuel
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/152
-- Commit Summary --
* added RURI-pattern matching and priority
-- File Changes --
M modules/permissions/hash.c (65)
M modules/permissions/hash.h (8)
M modules/permissions/permissions.c (4)
M modules/permissions/permissions.h (2)
M modules/permissions/trusted.c (103)
M utils/kamctl/db_sqlite/permissions-create.sql (6)
M utils/kamctl/mysql/permissions-create.sql (6)
M utils/kamctl/oracle/permissions-create.sql (6)
M utils/kamctl/postgres/permissions-create.sql (6)
M utils/kamctl/xhttp_pi/permissions-table (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/152.patchhttps://github.com/kamailio/kamailio/pull/152.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/152
Hello everyone,
We are thinking of a way to debug per module memory consumption (both
private and shared). Something like a "kamctl fifo shmem***module_name*"
to print how much memory has been alloc'ed for that module and which
function had alloc'ed.
One of the solutions would be to make use of the shm_info() and
pkg_info(), call them at the beginning and at the end of a function and
do some subtraction at the end. Then correlate this data with a per
module stats which will be printed with "kamctl stats *module_name*".
This would be ok if one needs mem stats only for some specific modules.
Another solution would be to make use of the *_malloc stubs used when
MEM_DEBUG is enabled and keep the function name and size. Buf it would
be hard to count how much memory is alloc'ed by the higher module
function in scenarios when the actual allocations are done in other
modules (e.g. db_allocate_rows()).
Also we have in mind that one would not want to compile kamailio with
MEM_DEBUG flag but still want to make use of the feature...
If you think of some other solution or have some advices for this,
please comment.
Regards,
1&1 Team