id summary reporter owner description type status milestone component version severity resolution keywords cc 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 James E. King, III Steven Watanabe "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: {{{ 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 }}} 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. {{{ 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... }}} {{{ 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... }}}" Bugs new Boost 1.66.0 random Boost 1.65.0 Problem