I had an instance of SER crash in production with this error message from qm_debug_frag:
[mem/q_malloc.c:149]: BUG: qm_*: fragm. 0x4cee3b88 (address 0x4cee3ba0) end overwritten(0, 0)!
The fragment end was been overwritten with zeroes... buffer overflow? Or an aliasing bug? Maybe a double-free?
It would be much easier to debug problems like this if qm_debug_frag printed the call site where qm_malloc/free was invoked from. And now it does! You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/361
-- Commit Summary --
* mem/q_malloc: log more diagnostic information in qm_debug_frag
-- File Changes --
M mem/q_malloc.c (33)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/361.patch https://github.com/kamailio/kamailio/pull/361.diff
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/361
Are you running old ser version? Or you just referred to it as SER, if yes, what version are you running?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/361#issuecomment-146142639
Hi, @miconda. In production, I'm running Kamailio 3.2.3 (59f87e). I just called it SER because the `make_and_install` build script generates a binary called `ser`.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/361#issuecomment-146188201
If it would be a double free, then that should be caught earlier, iirc. Likely to be a buffer overflow, which may be fixed meanwhile, because 3.2.3 is rather old, you should at least upgrade to latest 3.2.x.
If you got a coredump, then print the content of the fragment to see what piece of code allocated it.
Regarding the PR, the commit message is not strictly related to the code changes, but the discussion here, so it doesn't really suits for a commit history. Once I get the time to check it and all ok, then I will apply it manually, changing the commit message to be relevant for the code changes, according to:
* http://www.kamailio.org/wiki/devel/github-contributions
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/361#issuecomment-146201755
Thanks!
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/361#issuecomment-146211859
The commit was pushed manually (7c9a87948d9db5be511e94877c1eb3cdc411622c), with commit message updated to reflect only the source code changes.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/361#issuecomment-151843403
Closed #361.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/361#event-447982682
Thank you.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/361#issuecomment-151843955