<p></p>
<p>Since <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/joto/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/joto">@joto</a> asked me to provide a fix, rather than just reporting random valgrind issues, my proposal would be an additional check in get_sparse to check for sizeSparseTuples == 0. This eliminates the valgrind error, while test cases are still passing.</p>
<p>Does this make sense?</p>
<pre><code>osmium::Location node_ram_cache::get_sparse(osmid_t id) const
{
    if (sizeSparseTuples == 0) {
      return osmium::Location{};
    }

    int64_t pivotPos = sizeSparseTuples >> 1;
    int64_t minPos = 0;
    int64_t maxPos = sizeSparseTuples;

    while (minPos <= maxPos) {
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/issues/1442#issuecomment-811263736">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353WY24NCBUVSZCCFJL3TGNKCPANCNFSM42E4XVEQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353WDWHNF7WDWZSQXR23TGNKCPA5CNFSM42E4XVE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGBNON6A.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/issues/1442#issuecomment-811263736",
"url": "https://github.com/openstreetmap/osm2pgsql/issues/1442#issuecomment-811263736",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>