<p>Hello,</p>

<p>In my tests, the crash no longer occurs with the provided commit.</p>

<p>The underlying issue is that, indeed, the cachedb_sql module does not properly implement the cachedb interface - it manages it's own global connection to the back-end instead of allowing the interface to do it ( this is a side effect of the fact that the module was implemented following the cachedb_local template where there is no actual connection ).</p>

<p>For a full example of the way the interface was meant to work, please take a look at the cachedb_redis ( eg. the init function from the cachedb interface should actually create the connection to the backend , instead of creating the connection in the mod_init func of the back-end module. Further on, that connection can be retrieved when running a command by accessing the cachedb_con-&gt;data pointer ).</p>

<p>Best Regards,<br>
Vlad</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href='https://github.com/OpenSIPS/opensips/issues/197#issuecomment-42185336'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/5479561__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxNDkxNDM5NSwiZGF0YSI6eyJpZCI6Mjk3MDczMzB9fQ==--0cd77616196f1b34bfc875e7882670fce30c51ab.gif' height='1' width='1'></p>