[sr-dev] [kamailio/kamailio] htable race condition on expired keys (#1152)

Daniel-Constantin Mierla notifications at github.com
Fri Jun 23 18:49:22 CEST 2017


Digging further I found that the handling of expired records on get/add operations was resulting in accessing the item again, after it was freed, in the case the item was accessed from event route. In your case it was exposed by:

  * https://github.com/2600hz/kazoo-configs-kamailio/blob/master/kamailio/nodes-role.cfg#L159

If the expired item was like `media=>xyz::zone`, next line is accessing it, by extracting xyz from $shtrecord() and then taking it again via $sht().

So I removed the delete operation and execution of event route for expired records during get/add operations, but slightly different than your patch, to be sure it starts with a fresh value for expired value in add operation.

Not doing the delete on add/get is making things consistent with set operations. Check for expired is still done, but no event route execution and delete. The delete and event route execution will be done by auto-expire in all cases (no longer mixed with get/add, so coherent with set behaviour, as add op is practically a set +/- a value).

I if you can give it a try and no issues found, feel free to backport -- if you don't get the time, I will do it sometime next week, once I am more confident it doesn't break something else.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1152#issuecomment-310716862
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20170623/22261920/attachment.html>


More information about the sr-dev mailing list