<p>found a bug as described above , done some debugging and found that bson->data holds a NULL value when initializing the bson-iterator, which causes the crash Anyways fixed the crash by aplying a simple check<br>
problem in source file cachedb_mongodb_dbasec<br>
problematic code:</p>
<p>mongo_cmd_get_last_error(conn,MONGO_DATABASE(connection),&err_b);<br>
bson_iterator_init(&i,&err_b);<br>
while( bson_iterator_next(&i)) {<br>
LM_ERR("Fetched ERR key [%s] Val = ",bson_iterator_key(&i));<br>
switch( bson_iterator_type( &i ) ) {<br>
case BSON_DOUBLE:</p>
<p>fixed it:</p>
<p>mongo_cmd_get_last_error(conn,MONGO_DATABASE(con),&err_b);<br>
if(err_bdata!=NULL) // check<br>
{<br>
bson_iterator_init(&it,&err_b);<br>
while( bson_iterator_next(&it)) {<br>
LM_ERR("Fetched ERR key [%s] Val = ",bson_iterator_key(&it));<br>
switch( bson_iterator_type( &it ) ) {<br>
case BSON_DOUBLE:</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/OpenSIPS/opensips/issues/747">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOcie9wMejYQFZi3Cn_uXrcB403UoAKks5pXkc9gaJpZM4HAUvK.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/OpenSIPS/opensips/issues/747"></link>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>