https://projects.osmocom.org/https://projects.osmocom.org/favicon.ico?16647414092017-12-06T00:54:11ZOpen Source Mobile CommunicationsOsmoMSC - Bug #2667: osm-msc reports "invalid or out-of-range index"https://projects.osmocom.org/issues/2667?journal_id=65812017-12-06T00:54:11Zneelsnhofmeyr@sysmocom.de
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>20</i></li></ul><p>was able to reproduce that error message using a docker image based on debian-sid (see <a class="external" href="http://git.osmocom.org/docker-playground/commit/?id=0642e33a371782771bf4effbbb90d689f99f3b1c">http://git.osmocom.org/docker-playground/commit/?id=0642e33a371782771bf4effbbb90d689f99f3b1c</a> "add debian-sid-build, osmo-dev-on-debian-sid")</p> OsmoMSC - Bug #2667: osm-msc reports "invalid or out-of-range index"https://projects.osmocom.org/issues/2667?journal_id=65822017-12-06T01:59:50Zneelsnhofmeyr@sysmocom.de
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Feedback</i></li><li><strong>Assignee</strong> changed from <i>neels</i> to <i>laforge</i></li><li><strong>% Done</strong> changed from <i>20</i> to <i>90</i></li></ul><p>with <a class="external" href="https://gerrit.osmocom.org/5205">https://gerrit.osmocom.org/5205</a> I get:</p>
<pre>
20171206012939521 DDB <000d> ../../../../src/osmo-msc/src/libmsc/db.c:188 Running query: SELECT * FROM SMS WHERE sent IS NULL AND dest_addr > '' AND deliver_attempts <= 9 ORDER BY dest_addr, id LIMIT 1
20171206012939523 DDB <000d> ../../../../src/osmo-msc/src/libmsc/db.c:218 DBI: -6: An invalid or out-of-range index was passed to libdbi
</pre>
<p>With further investigation, it becomes clear that the error log comes from</p>
<pre>
if (!dbi_result_next_row(result)) {
</pre>
<p>i.e. from precisely the line that should determine whether any results have been returned. It is thus puzzling why the error cb is invoked here.</p>
<p>Even when I change it to a nonempty string, I get the error:</p>
<pre>
20171206014418800 DDB <000d> ../../../../src/osmo-msc/src/libmsc/db.c:188 Running query: SELECT * FROM SMS WHERE sent IS NULL AND dest_addr > '0' AND deliver_attempts <= 9 ORDER BY dest_addr, id LIMIT 1
20171206014418802 DDB <000d> ../../../../src/osmo-msc/src/libmsc/db.c:910 1
20171206014418802 DDB <000d> ../../../../src/osmo-msc/src/libmsc/db.c:913 2
20171206014418802 DDB <000d> ../../../../src/osmo-msc/src/libmsc/db.c:218 DBI: -6: An invalid or out-of-range index was passed to libdbi
20171206014418802 DDB <000d> ../../../src/libosmocore/src/backtrace.c:47 backtrace() returned 11 addresses
</pre>
<p>My initial conclusion is that this error is not caused by osmo-msc, but rather from an unstable libdbi.</p>
<p>However, I notice that the API offers dbi_result_*has*_next_row(), and if I call that before dbi_result_next_row(), the error output does not occur.<br />But we actually never do this elsewhere: we always just see whether the result is NULL, and if not go on to dbi_result_next_row() right away, relying on that return value.</p>
<p>I could write up a patch that adds this step everywhere, simple enough:</p>
<pre>
if (!dbi_result_has_next_row(result)
|| !dbi_result_next_row(result)) {
dbi_result_free(result);
return NULL;
}
</pre>
<p>OTOH I guess it this not important enough, after all it's just dbi, and it's just debian-unstable. What do you think?</p> OsmoMSC - Bug #2667: osm-msc reports "invalid or out-of-range index"https://projects.osmocom.org/issues/2667?journal_id=65892017-12-06T18:48:31Zalteholz
<ul></ul><p>neels wrote:</p>
<blockquote>
<p>My initial conclusion is that this error is not caused by osmo-msc, but rather from an unstable libdbi.</p>
</blockquote>
<p>recently there was a "fix" in libdbi. In case of an invalid index, the error handler was not called (the original call was commented out by error) and 0 was returned as a result of calling dbi_result_next_row() instead.<br />I think the error is due to result being 0 if the last row was already fetched and thus the preceding call to dbi_result_has_next_row() seems good.</p>
<blockquote>
<p>OTOH I guess it this not important enough, after all it's just dbi, and it's just debian-unstable. What do you think?</p>
</blockquote>
<p>debian unstable will become stable sooner or later ...</p> OsmoMSC - Bug #2667: osm-msc reports "invalid or out-of-range index"https://projects.osmocom.org/issues/2667?journal_id=65902017-12-06T19:20:09Zlaforge
<ul></ul><p>I think this discussion is one more sign we want to get rid of libdbi rather sooner<br />than later. Unfortunately we have way too few developers for way too much work<br />as-is :/</p> OsmoMSC - Bug #2667: osm-msc reports "invalid or out-of-range index"https://projects.osmocom.org/issues/2667?journal_id=66272017-12-10T13:51:19Zneelsnhofmeyr@sysmocom.de
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>In Progress</i></li><li><strong>Assignee</strong> changed from <i>laforge</i> to <i>neels</i></li></ul><p>actually now my laptop has moved to debian testing and I don't want to see these useless warnings all the time, hence submitted <a class="external" href="https://gerrit.osmocom.org/5265">https://gerrit.osmocom.org/5265</a></p> OsmoMSC - Bug #2667: osm-msc reports "invalid or out-of-range index"https://projects.osmocom.org/issues/2667?journal_id=66292017-12-10T15:34:11Zlaforge
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>90</i> to <i>100</i></li></ul>