<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello Rupesh,</p>
<p>the lock mode was changed, you find the reasoning (and the linked commit) in this issue:</p>
<p><a class="moz-txt-link-freetext" href="https://github.com/kamailio/kamailio/issues/577">https://github.com/kamailio/kamailio/issues/577</a></p>
<p>Cheers,</p>
<p>Henning<br>
</p>
<div class="moz-cite-prefix">Am 18.09.19 um 22:05 schrieb Rupesh Kumar:<br>
</div>
<blockquote type="cite" cite="mid:474478770.3383072.1568837127693@mail.yahoo.com">
<div class="yahoo-style-wrap" style="font-family:Helvetica Neue,
        Helvetica, Arial, sans-serif;font-size:13px;">
<div dir="ltr" data-setdir="false">Hi ,</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">Currently I am running kamailio 4.2 and now upgrading to kamailio 5.2 and was just going thru the changes.<br>
</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">In the file modules/usrloc/udomain.c inside the function free_udomain( ) , it appears that we are not protecting via lock_ulslot and unlock_ulslot doing free. Could it cause some race condition ?<br>
</div>
<div dir="ltr" data-setdir="false">May be its intentional but going thru the github history its there since day 1. I checked all branches in kamailio 4.x and we have the protection.</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">In 4.x <br>
</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">
<div>void free_udomain(udomain_t* _d)<br>
{<br>
    int i;<br>
    <br>
    if (_d->table) {<br>
        for(i = 0; i < _d->size; i++) {<br>
           <b> lock_ulslot(_d, i);</b><br>
            deinit_slot(_d->table + i);<br>
            <b>unlock_ulslot(_d, i);</b><br>
        }<br>
        shm_free(_d->table);<br>
<div>    }</div>
<div dir="ltr" data-setdir="false">    <span>shm_free(_d);</span><br>
</div>
<div>}</div>
<div><br>
</div>
<div dir="ltr" data-setdir="false">In 5.x</div>
<div dir="ltr" data-setdir="false"><br>
</div>
<div dir="ltr" data-setdir="false">
<div>void free_udomain(udomain_t* _d)<br>
{<br>
    int i;<br>
    <br>
    if (_d->table) {<br>
        for(i = 0; i < _d->size; i++) {<br>
            deinit_slot(_d->table + i);<br>
        }<br>
        shm_free(_d->table);<br>
    }<br>
    shm_free(_d);<br>
}</div>
<div><br>
</div>
</div>
</div>
<div><br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">-- 
Kamailio Merchandising - <a class="moz-txt-link-freetext" href="https://skalatan.de/merchandising/">https://skalatan.de/merchandising/</a>
Kamailio services - <a class="moz-txt-link-freetext" href="https://skalatan.de/services">https://skalatan.de/services</a>
Henning Westerholt - <a class="moz-txt-link-freetext" href="https://skalatan.de/blog/">https://skalatan.de/blog/</a></pre>
</body>
</html>