Boost C++ Libraries: Ticket #8954: clang static analyser undefined value in boost/libs/filesystem/src/unique_path.cpp https://svn.boost.org/trac10/ticket/8954 <p> Assigned value is garbage or undefined at line 131. </p> <p> Please <a class="ext-link" href="https://ci.nedprod.com/job/Boost.AFIO%20Static%20Analysis%20Pre-Check/112/clangScanBuildBugs/"><span class="icon">​</span>https://ci.nedprod.com/job/Boost.AFIO%20Static%20Analysis%20Pre-Check/112/clangScanBuildBugs/</a>? for more detail. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8954 Trac 1.4.3 anonymous Sat, 07 Sep 2013 20:05:01 GMT <link>https://svn.boost.org/trac10/ticket/8954#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8954#comment:1</guid> <description> <p> It is obviously used right below on lines 132 and 133. Line 132 shifts it 4 bits to the right if <code>nibbles_used</code> is odd. Then it's lower nibble is set to <code>s[i]</code> on line 133. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 08 Oct 2013 17:39:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8954#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8954#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/8954#comment:1" title="Comment 1">anonymous</a>: </p> <blockquote class="citation"> <p> It is obviously used right below on lines 132 and 133. Line 132 shifts it 4 bits to the right if <code>nibbles_used</code> is odd. Then it's lower nibble is set to <code>s[i]</code> on line 133. </p> </blockquote> <p> The code uses ran<a class="missing changeset" title="No changeset 0 in the repository">[0]</a> unassigned. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Niall Douglas</dc:creator> <pubDate>Mon, 28 Oct 2013 15:50:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8954#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8954#comment:3</guid> <description> <p> The analyser sees this possibility: </p> <p> char ran<a class="changeset" href="https://svn.boost.org/trac10/changeset/16" title="*** empty log message *** ">[16]</a>; nibbles_used=32; c=ran[nibbles_used/2]; </p> <p> Do you see the undefined behaviour now? ran shouldn't be read from ran<a class="changeset" href="https://svn.boost.org/trac10/changeset/16" title="*** empty log message *** ">[16]</a>. </p> <p> Niall </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Niall Douglas</dc:creator> <pubDate>Mon, 27 Jan 2014 19:13:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8954#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8954#comment:4</guid> <description> <p> New information: I upgraded the static analyser to use clang 3.4 which is greatly improved. Now this report in filesystem is the ONLY static analysis failure reported for AFIO's use of Boost. </p> <p> See <a class="ext-link" href="https://ci.nedprod.com/view/All/job/Boost.AFIO%20Static%20Analysis%20Pre-Check/lastSuccessfulBuild/clangScanBuildBugs/"><span class="icon">​</span>https://ci.nedprod.com/view/All/job/Boost.AFIO%20Static%20Analysis%20Pre-Check/lastSuccessfulBuild/clangScanBuildBugs/</a> </p> <p> Niall </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Niall Douglas</dc:creator> <pubDate>Mon, 28 Jul 2014 10:23:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8954#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8954#comment:5</guid> <description> <p> This bug is still being reported by the clang 3.4 static analyser in the forthcoming Boost 1.56 beta. It would be really nice if this got fixed. </p> <p> Niall </p> </description> <category>Ticket</category> </item> </channel> </rss>