[sr-dev] [kamailio/kamailio] 5.6 @ ebda78c92c inserts wrong timestamps in acc_cdrs table (Issue #3243)

Daniel-Constantin Mierla notifications at github.com
Mon Sep 26 13:19:22 CEST 2022


Well, the changes are related to getting dialog variable value, they seem larger because I had to make a couple of variants to cover different use case. I do not use dialog variables myself (typically I rely on htable for "call-context" data), but given that there are quite some reports on random crashes with dialog, I looked over and noticed that access to dlg variable value is unprotected.

Practically, it was returning the pointer to the value in the memory, without keeping any lock on or having reference counters. That makes it vulnerable to race conditions (e.g., when another process changes the value or dialog gets destroyed) and it could have been the reason for those unpredictable crashes.

I tried a quick fix with a static variable and clone in pv buffer, but it had side effects to other modules based on how they used to access (and keep references) many variables at the same time. So I decided to go for a more elaborate solution with a couple for getter functions to cover better use cases.

A new major release from master branch is not yet planned, it could take a few months.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3243#issuecomment-1257877658
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/3243/1257877658 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220926/c80bd52c/attachment.htm>


More information about the sr-dev mailing list