<p>found a bug as described above , done some debugging and found that bson-&gt;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),&amp;err_b);<br>
            bson_iterator_init(&amp;i,&amp;err_b);<br>
            while( bson_iterator_next(&amp;i)) {<br>
                LM_ERR("Fetched ERR key [%s] Val = ",bson_iterator_key(&amp;i));<br>
                switch( bson_iterator_type( &amp;i ) ) {<br>
                    case BSON_DOUBLE:</p>

<p>fixed it:</p>

<p>mongo_cmd_get_last_error(conn,MONGO_DATABASE(con),&amp;err_b);<br>
                        if(err_bdata!=NULL) // check<br>
                        {<br>
                                bson_iterator_init(&amp;it,&amp;err_b);<br>
                                while( bson_iterator_next(&amp;it)) {<br>
                                        LM_ERR("Fetched ERR key [%s] Val = ",bson_iterator_key(&amp;it));<br>
                                        switch( bson_iterator_type( &amp;it ) ) {<br>
                                                case BSON_DOUBLE:</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/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>