<p>This <strong>is not</strong> happening when setting the module facility, for the above, same conditions.<br>
This <strong>is</strong> happening also before pull-request [1] using "kamcmd dbg.mod_level core 1". <br>
After some debugging I've noticed that this <strong>is</strong> happening when trying to set a level for a module name whose <code>idx = hid&(_dbg_mod_table_size-1);</code> is even number?! (i.e. module name "core" reduces to an even index); the idx is always in the range <code>_dbg_mod_table_size-1</code> as it should be.</p>

<p>Trying to solve this, I commented the lock_get/release in <code>dbg_set_mod_debug_level()</code> and saw it's working; kamailio doesn't freeze anymore. Thus, I tried to refactor the locks in <code>struct _dbg_mod_slot</code> to be dynamically allocated/deallocated using lock_alloc()/destroy() without success.</p>

<p>I'm out of ideas. Do you have any idea what might lead to this strange deadlock?</p>

<p>[1] <a href="https://github.com/kamailio/kamailio/pull/462" class="issue-link js-issue-link" data-url="https://github.com/kamailio/kamailio/issues/462" data-id="124930796" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#462</a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/463">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZeAOoUbxaZoxMeNgotq6DNjBeKf9ks5pXP_6gaJpZM4G_jLb.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/463"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>