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, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/issues/3243/1257877658@github.com>