Boost C++ Libraries: Ticket #12926: UBSAN complains about "left shift of negative value -4" from boost::icl::interval_bounds::reverse_right() https://svn.boost.org/trac10/ticket/12926 <pre class="wiki">/usr/include/boost/icl/interval_bounds.hpp:45:74: runtime error: left shift of negative value -4 #0 0x2e91091 in boost::icl::interval_bounds::reverse_right() const /usr/include/boost/icl/interval_bounds.hpp:45 #1 0x2eec8cc in boost::enable_if&lt;boost::icl::has_dynamic_bounds&lt;boost::icl::continuous_interval&lt;compatible_ring_position, std::less&gt; &gt;, boost::icl::continuous_interval&lt;compatible_ring_position, std::less&gt;::bounded_domain_type&gt;::type boost::icl::reverse_bounded_upper&lt;boost::icl::continuous_interval&lt;compatible_ring_position, std::less&gt; &gt;(boost::icl::continuous_interval&lt;compatible_ring_position, std::less&gt; const&amp;) /usr/include/boost/icl/concept/interval.hpp:509 </pre><p> boost-1.60.0-8.fc24.x86_64 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12926 Trac 1.4.3 dnanar@… Sat, 08 Apr 2017 17:00:01 GMT cc, version changed https://svn.boost.org/trac10/ticket/12926#comment:1 https://svn.boost.org/trac10/ticket/12926#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">dnanar@…</span> added </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.60.0</span> → <span class="trac-field-new">Boost 1.62.0</span> </li> </ul> <p> Same problem here, different use case: </p> <pre class="wiki">interval_set&lt;uint32_t&gt; a; a.insert({50,4294967295}); a.insert({25,4294967295}); </pre><p> causes this. Debian stock libboost package (Version: 1.62.0.1). The exact error in my case is: </p> <pre class="wiki">/usr/include/boost/icl/interval_bounds.hpp:45:74: runtime error: left shift of negative value -3 </pre> Ticket gson@… Fri, 16 Mar 2018 14:58:30 GMT <link>https://svn.boost.org/trac10/ticket/12926#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12926#comment:2</guid> <description> <p> I'm also having this problem. Here's a complete program to reproduce it: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;stdint.h&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/icl/interval_set.hpp&gt;</span><span class="cp"></span> <span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="p">)</span> <span class="p">{</span> <span class="n">boost</span><span class="o">::</span><span class="n">icl</span><span class="o">::</span><span class="n">interval_set</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;</span> <span class="n">a</span><span class="p">;</span> <span class="n">a</span><span class="p">.</span><span class="n">insert</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">icl</span><span class="o">::</span><span class="n">interval</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;::</span><span class="n">right_open</span><span class="p">(</span><span class="o">-</span><span class="mi">100</span><span class="p">,</span> <span class="mi">100</span><span class="p">));</span> <span class="n">a</span><span class="p">.</span><span class="n">insert</span><span class="p">(</span><span class="o">-</span><span class="mi">50</span><span class="p">);</span> <span class="p">}</span> </pre></div></div><p> Building and running: </p> <pre class="wiki">$ g++ -fsanitize=undefined test.cc -o test $ ./test /usr/include/boost/icl/interval_bounds.hpp:45:74: runtime error: left shift of negative value -4 </pre><p> This is on Debian 9. </p> </description> <category>Ticket</category> </item> </channel> </rss>