Opened 5 years ago

Last modified 5 years ago

#13247 new Bugs

test_independent_bits32 fails unit test in release mode only at -O2 and higher under clang 3.8, 3.9, 4.0, 5.0

Reported by: James E. King, III Owned by: Steven Watanabe
Milestone: Boost 1.66.0 Component: random
Version: Boost 1.65.0 Severity: Problem
Keywords: Cc:

Description

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...

Change History (3)

comment:1 by James E. King, III, 5 years ago

Milestone: To Be DeterminedBoost 1.66.0
Resolution: fixed
Status: newclosed

comment:2 by James E. King, III, 5 years ago

Resolution: fixed
Status: closedreopened

Reopening until merged into master.

comment:3 by James E. King, III, 5 years ago

Owner: changed from No-Maintainer to Steven Watanabe
Status: reopenednew
Note: See TracTickets for help on using tickets.