Boost C++ Libraries: Ticket #13247: test_independent_bits32 fails unit test in release mode only at -O2 and higher under clang 3.8, 3.9, 4.0, 5.0 https://svn.boost.org/trac10/ticket/13247 <p> I'm working on adding CI support to Boost.Random and I found that the clang build jobs are failing on this test as follows. To reproduce, use Boost.Random from the test directory with ubuntu zesty and clang 4.0: </p> <pre class="wiki">passes: ../../../b2 toolset=clang variant=release test_independent_bits32 clean ../../../b2 toolset=clang variant=release cxxflags="-O0" test_independent_bits32 passes: ../../../b2 toolset=clang variant=release test_independent_bits32 clean ../../../b2 toolset=clang variant=release cxxflags="-O1" test_independent_bits32 fails: ../../../b2 toolset=clang variant=release test_independent_bits32 clean ../../../b2 toolset=clang variant=release cxxflags="-O2" test_independent_bits32 </pre><p> No versions of gcc at any optimization level seem to fail and ubsan testing also does not fail (but it is a debug build) so this needs further investigation to understand if it is a clang optimizer bug that's been around for a while or if the test is wrong for clang somehow. </p> <pre class="wiki">testing.capture-output bin.v2/libs/random/test/test_independent_bits32.test/clang-gnu-linux-3.9.0/release/threadapi-pthread/test_independent_bits32.run ====== BEGIN OUTPUT ====== Running 13 test cases... libs/random/test/test_generator.ipp(246): error: in "validate": check urng() == 4123659995U has failed [0 != 4123659995] libs/random/test/test_generator.ipp(256): error: in "validate_seed_seq": check urng() == 666528879U has failed [0 != 666528879] libs/random/test/test_generator.ipp(268): error: in "validate_iter": check urng() == 3408548740U has failed [0 != 3408548740] libs/random/test/test_generator.ipp(278): error: in "test_generate": check { actual, actual + N } == { expected, expected + N } has failed. Mismatch at position 0: 0 != 3499211612 Mismatch at position 1: 0 != 581869302 Mismatch at position 2: 0 != 3890346734 Mismatch at position 3: 0 != 3586334585 *** 4 failures are detected in the test module "Master Test Suite" EXIT STATUS: 201 ====== END OUTPUT ====== ...failed testing.capture-output bin.v2/libs/random/test/test_independent_bits32.test/clang-gnu-linux-3.9.0/release/threadapi-pthread/test_independent_bits32.run... </pre><pre class="wiki">testing.capture-output bin.v2/libs/random/test/test_independent_bits32.test/clang-gnu-linux-5.0.1/release/threadapi-pthread/test_independent_bits32.run ====== BEGIN OUTPUT ====== Running 13 test cases... libs/random/test/test_generator.ipp(246): error: in "validate": check urng() == 4123659995U has failed [0 != 4123659995] libs/random/test/test_generator.ipp(256): error: in "validate_seed_seq": check urng() == 666528879U has failed [0 != 666528879] libs/random/test/test_generator.ipp(268): error: in "validate_iter": check urng() == 3408548740U has failed [0 != 3408548740] libs/random/test/test_generator.ipp(278): error: in "test_generate": check { actual, actual + N } == { expected, expected + N } has failed. Mismatch at position 0: 0 != 3499211612 Mismatch at position 1: 0 != 581869302 Mismatch at position 2: 0 != 3890346734 Mismatch at position 3: 0 != 3586334585 *** 4 failures are detected in the test module "Master Test Suite" EXIT STATUS: 201 ====== END OUTPUT ====== ...failed testing.capture-output bin.v2/libs/random/test/test_independent_bits32.test/clang-gnu-linux-5.0.1/release/threadapi-pthread/test_independent_bits32.run... </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13247 Trac 1.4.3 James E. King, III Tue, 10 Oct 2017 16:09:46 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/13247#comment:1 https://svn.boost.org/trac10/ticket/13247#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.66.0</span> </li> </ul> Ticket James E. King, III Tue, 10 Oct 2017 16:10:03 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/13247#comment:2 https://svn.boost.org/trac10/ticket/13247#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Reopening until merged into master. </p> Ticket James E. King, III Tue, 10 Oct 2017 16:10:23 GMT owner, status changed https://svn.boost.org/trac10/ticket/13247#comment:3 https://svn.boost.org/trac10/ticket/13247#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">No-Maintainer</span> to <span class="trac-author">Steven Watanabe</span> </li> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">new</span> </li> </ul> Ticket