Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release/6.3.0: Test suite does not pass gecode/test/int.cpp:289: void Test::Int::TestSpace::prune(int, bool, Gecode::Support::RandomGenerator &): Assertion '(v < x[i].max()) && (v >= x[i].min())' failed. #200

Open
LebedevRI opened this issue Aug 23, 2024 · 3 comments

Comments

@LebedevRI
Copy link

Built with clang-18 + -O2 -UNDEBUG

[0/1] Running tests...
Test project /<<PKGBUILDDIR>>-build/build/stage-2/minizinc-meta/gecode
    Start 1: test
1/1 Test #1: test .............................Subprocess aborted***Exception:   0.57 sec
Int::Arithmetic::Mult::XYZ::Bnd::C ++
Int::Arithmetic::Mult::XYZ::Dom::A gecode-test: /<<PKGBUILDDIR>>/gecode/test/int.cpp:289: void Test::Int::TestSpace::prune(int, bool, Gecode::Support::RandomGenerator &): Assertion `(v < x[i].max()) && (v >= x[i].min())' failed.


0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.57 sec

The following tests FAILED:
          1 - test (Subprocess aborted)
Errors while running CTest
FAILED: CMakeFiles/test.util 

@LebedevRI LebedevRI changed the title release/6.3.0: Test suite does not pass gecode/test/int.cpp:289: void Test::Int::TestSpace::prune(int, bool, Gecode::Support::RandomGenerator &): Assertion (v < x[i].max()) && (v >= x[i].min())' failed.` release/6.3.0: Test suite does not pass gecode/test/int.cpp:289: void Test::Int::TestSpace::prune(int, bool, Gecode::Support::RandomGenerator &): Assertion '(v < x[i].max()) && (v >= x[i].min())' failed. Aug 23, 2024
LebedevRI added a commit to LebedevRI/gecode that referenced this issue Aug 23, 2024
Ensure that it gets built when testing is enabled,
and that CMake actually uses said executable target,
and not some binary.

That being said, the test does not pass with assertions enabled:
Gecode#200
@zayenz
Copy link
Member

zayenz commented Sep 6, 2024

What is the exact set of commands you rand to get this result? I've tried various ways, and I can not reproduce it.

In addition, looking at the code I am unclear on how this assert could trigger. I can of course be missing something, but it seems to me like this should not happen.

@LebedevRI
Copy link
Author

I'm guessing you have some UB. Is gecode asan/ubsan clean? I've seen quite a few SIGSEGV's from minizinc.

$ CC=clang-18 CXX=clang++-18 cmake -DCMAKE_BUILD_TYPE=NONE -DCMAKE_C_FLAGS="-O3 -UNDEBUG" -DCMAKE_CXX_FLAGS="-O3 -UNDEBUG" -DBUILD_TESTNG=ON .. && ninja && ninja gecode-test && ctest -VV
-- The C compiler identification is Clang 18.1.8
-- The CXX compiler identification is Clang 18.1.8
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang-18 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++-18 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find MPFR, use MPFR_ROOT to hint its location (missing: MPFR_LIBRARY MPFR_INCLUDE) 
-- Got VERSION=6.3.0 from configure.ac
-- Performing Test HAVE_VISIBILITY_HIDDEN_FLAG
-- Performing Test HAVE_VISIBILITY_HIDDEN_FLAG - Success
-- Looking for mmap
-- Looking for mmap - found
-- Performing Test HAVE_ALWAYS_INLINE
-- Performing Test HAVE_ALWAYS_INLINE - Success
-- Performing Test HAVE_FORCE_INLINE
-- Performing Test HAVE_FORCE_INLINE - Failed
-- Performing Test HAVE_BUILTIN_FFSL
-- Performing Test HAVE_BUILTIN_FFSL - Success
-- Performing Test HAVE_BUILTIN_POPCOUNTLL
-- Performing Test HAVE_BUILTIN_POPCOUNTLL - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done (2.1s)
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    BUILD_TESTNG


-- Build files have been written to: /repositories/minizinc-meta/gecode/build
[100% 202/202][100% 00:38 + 00:00] Linking CXX executable bin/fzn-gecode
[100% 181/181][100% 00:18 + 00:00] Linking CXX executable bin/gecode-test
UpdateCTestConfiguration  from :/repositories/minizinc-meta/gecode/build/DartConfiguration.tcl
UpdateCTestConfiguration  from :/repositories/minizinc-meta/gecode/build/DartConfiguration.tcl
Test project /repositories/minizinc-meta/gecode/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
    Start 1: test

1: Test command: /repositories/minizinc-meta/gecode/build/bin/gecode-test "-iter" "2" "-test" "Branch::Int::Dense::3" "-test" "Int::Linear::Int::Int::Eq::Bnd::12::4" "-test" "Int::Distinct::Random" "-test" "Int::Arithmetic::Mult::XYZ::Bnd::C" "-test" "Int::Arithmetic::Mult::XYZ::Dom::A" "-test" "Search::BAB::Sol::BalGr::Binary::Binary::Binary::1::1"
1: Working Directory: /repositories/minizinc-meta/gecode/build
1: Test timeout computed to be: 10000000
1: Int::Arithmetic::Mult::XYZ::Bnd::C ++
1: Int::Arithmetic::Mult::XYZ::Dom::A gecode-test: /repositories/minizinc-meta/gecode/test/int.cpp:289: void Test::Int::TestSpace::prune(int, bool, Gecode::Support::RandomGenerator &): Assertion `(v < x[i].max()) && (v >= x[i].min())' failed.
1/1 Test #1: test .............................Subprocess aborted***Exception:   0.57 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.57 sec

The following tests FAILED:
          1 - test (Subprocess aborted)
Errors while running CTest
Output from these tests are in: /repositories/minizinc-meta/gecode/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
$ git describe 
release-6.2.0-205-ge26386de1

(aka #201)

@LebedevRI
Copy link
Author

Yup, we're firmly in UB lands:

$ CC=clang-18 CXX=clang++-18 cmake -DCMAKE_BUILD_TYPE=NONE -DCMAKE_C_FLAGS="-O1 -UNDEBUG -fsanitize=address,undefined" -DCMAKE_CXX_FLAGS="-O1 -UNDEBUG -fsanitize=address,undefined" -DBUILD_TESTING=ON .. && ninja && ctest -VV
-- The C compiler identification is Clang 18.1.8
-- The CXX compiler identification is Clang 18.1.8
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang-18 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++-18 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find MPFR, use MPFR_ROOT to hint its location (missing: MPFR_LIBRARY MPFR_INCLUDE) 
-- Got VERSION=6.3.0 from configure.ac
-- Performing Test HAVE_VISIBILITY_HIDDEN_FLAG
-- Performing Test HAVE_VISIBILITY_HIDDEN_FLAG - Success
-- Looking for mmap
-- Looking for mmap - found
-- Performing Test HAVE_ALWAYS_INLINE
-- Performing Test HAVE_ALWAYS_INLINE - Success
-- Performing Test HAVE_FORCE_INLINE
-- Performing Test HAVE_FORCE_INLINE - Failed
-- Performing Test HAVE_BUILTIN_FFSL
-- Performing Test HAVE_BUILTIN_FFSL - Success
-- Performing Test HAVE_BUILTIN_POPCOUNTLL
-- Performing Test HAVE_BUILTIN_POPCOUNTLL - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done (1.1s)
-- Generating done (0.0s)
-- Build files have been written to: /repositories/minizinc-meta/gecode/build
[100% 383/383][100% 04:29 + 00:00] Linking CXX executable bin/gecode-test
UpdateCTestConfiguration  from :/repositories/minizinc-meta/gecode/build/DartConfiguration.tcl
UpdateCTestConfiguration  from :/repositories/minizinc-meta/gecode/build/DartConfiguration.tcl
Test project /repositories/minizinc-meta/gecode/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
    Start 1: test

1: Test command: /repositories/minizinc-meta/gecode/build/bin/gecode-test "-iter" "2" "-test" "Branch::Int::Dense::3" "-test" "Int::Linear::Int::Int::Eq::Bnd::12::4" "-test" "Int::Distinct::Random" "-test" "Int::Arithmetic::Mult::XYZ::Bnd::C" "-test" "Int::Arithmetic::Mult::XYZ::Dom::A" "-test" "Search::BAB::Sol::BalGr::Binary::Binary::Binary::1::1"
1: Working Directory: /repositories/minizinc-meta/gecode/build
1: Test timeout computed to be: 10000000
1: Int::Arithmetic::Mult::XYZ::Bnd::C /repositories/minizinc-meta/gecode/gecode/kernel/core.hpp:3630:12: runtime error: downcast of address 0x51300002ce18 which does not point to an object of type 'Brancher'
1: 0x51300002ce18: note: object has invalid vptr
1:  30 51 00 00  10 ce 02 00 30 51 00 00  20 ce 02 00 30 51 00 00  20 ce 02 00 30 51 00 00  be be be be
1:               ^~~~~~~~~~~~~~~~~~~~~~~
1:               invalid vptr
1:     #0 0x555b28a7e9e8 in Gecode::Space::Space() (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x980f9e8) (BuildId: 982a4d5f82e76e5d)
1:     #1 0x555b210466b9 in Test::Int::TestSpace::TestSpace(int, Gecode::IntSet&, Test::Int::Test*) (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1dd76b9) (BuildId: 982a4d5f82e76e5d)
1:     #2 0x555b210561e0 in Test::Int::Test::run() (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1de71e0) (BuildId: 982a4d5f82e76e5d)
1:     #3 0x555b20f8a4ce in Test::run_test(Test::Base*, unsigned int, Test::Options const&, std::ostream&) (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1d1b4ce) (BuildId: 982a4d5f82e76e5d)
1:     #4 0x555b20f8ae09 in Test::run_tests(std::vector<Test::Base*, std::allocator<Test::Base*>> const&, Test::Options const&) (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1d1be09) (BuildId: 982a4d5f82e76e5d)
1:     #5 0x555b20f8b979 in main (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1d1c979) (BuildId: 982a4d5f82e76e5d)
1:     #6 0x7f3a54411db9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
1:     #7 0x7f3a54411e74 in __libc_start_main csu/../csu/libc-start.c:360:3
1:     #8 0x555b20ea94e0 in _start (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1c3a4e0) (BuildId: 982a4d5f82e76e5d)
1: 
1: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /repositories/minizinc-meta/gecode/gecode/kernel/core.hpp:3630:12 
1: /repositories/minizinc-meta/gecode/gecode/kernel/core.hpp:4356:13: runtime error: applying non-zero offset 18446744073709551608 to null pointer
1:     #0 0x555b2572d95f in Gecode::dom(Gecode::Home, Gecode::IntVarArgs const&, Gecode::IntVarArgs const&, Gecode::IntPropLevel) (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x64be95f) (BuildId: 982a4d5f82e76e5d)
1:     #1 0x555b21046ae4 in Test::Int::TestSpace::TestSpace(int, Gecode::IntSet&, Test::Int::Test*) (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1dd7ae4) (BuildId: 982a4d5f82e76e5d)
1:     #2 0x555b210561e0 in Test::Int::Test::run() (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1de71e0) (BuildId: 982a4d5f82e76e5d)
1:     #3 0x555b20f8a4ce in Test::run_test(Test::Base*, unsigned int, Test::Options const&, std::ostream&) (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1d1b4ce) (BuildId: 982a4d5f82e76e5d)
1:     #4 0x555b20f8ae09 in Test::run_tests(std::vector<Test::Base*, std::allocator<Test::Base*>> const&, Test::Options const&) (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1d1be09) (BuildId: 982a4d5f82e76e5d)
1:     #5 0x555b20f8b979 in main (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1d1c979) (BuildId: 982a4d5f82e76e5d)
1:     #6 0x7f3a54411db9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
1:     #7 0x7f3a54411e74 in __libc_start_main csu/../csu/libc-start.c:360:3
1:     #8 0x555b20ea94e0 in _start (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1c3a4e0) (BuildId: 982a4d5f82e76e5d)
1: 
1: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /repositories/minizinc-meta/gecode/gecode/kernel/core.hpp:4356:13 
1: AddressSanitizer:DEADLYSIGNAL
1: =================================================================
1: ==15044==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x7f3a546b1a2f bp 0x7fff699243f0 sp 0x7fff69924070 T0)
1: ==15044==The signal is caused by a READ memory access.
1: ==15044==Hint: this fault was caused by a dereference of a high value address (see register values below).  Disassemble the provided pc to learn which register was used.
1:     #0 0x7f3a546b1a2f in __dynamic_cast /build/reproducible-path/gcc-14-14.2.0/build/x86_64-linux-gnu/libstdc++-v3/libsupc++/../../../../src/libstdc++-v3/libsupc++/dyncast.cc:71:21
1:     #1 0x555b20f84a73 in __ubsan::checkDynamicType(void*, void*, unsigned long) crtstuff.c
1:     #2 0x555b20f83eb2 in HandleDynamicTypeCacheMiss(__ubsan::DynamicTypeCacheMissData*, unsigned long, unsigned long, __ubsan::ReportOptions) crtstuff.c
1:     #3 0x555b20f83e7d in __ubsan_handle_dynamic_type_cache_miss (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1d14e7d) (BuildId: 982a4d5f82e76e5d)
1:     #4 0x555b28a925aa in Gecode::Space::status(Gecode::StatusStatistics&) (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x98235aa) (BuildId: 982a4d5f82e76e5d)
1:     #5 0x555b23201972 in Gecode::Search::WorkerToEngine<Gecode::Search::Seq::DFS<Gecode::Search::NoTraceRecorder>>::WorkerToEngine(Gecode::Space*, Gecode::Search::Options const&) (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x3f92972) (BuildId: 982a4d5f82e76e5d)
1:     #6 0x555b231f75cf in Gecode::Search::dfsengine(Gecode::Space*, Gecode::Search::Options const&) (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x3f885cf) (BuildId: 982a4d5f82e76e5d)
1:     #7 0x555b21056642 in Test::Int::Test::run() (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1de7642) (BuildId: 982a4d5f82e76e5d)
1:     #8 0x555b20f8a4ce in Test::run_test(Test::Base*, unsigned int, Test::Options const&, std::ostream&) (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1d1b4ce) (BuildId: 982a4d5f82e76e5d)
1:     #9 0x555b20f8ae09 in Test::run_tests(std::vector<Test::Base*, std::allocator<Test::Base*>> const&, Test::Options const&) (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1d1be09) (BuildId: 982a4d5f82e76e5d)
1:     #10 0x555b20f8b979 in main (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1d1c979) (BuildId: 982a4d5f82e76e5d)
1:     #11 0x7f3a54411db9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
1:     #12 0x7f3a54411e74 in __libc_start_main csu/../csu/libc-start.c:360:3
1:     #13 0x555b20ea94e0 in _start (/repositories/minizinc-meta/gecode/build/bin/gecode-test+0x1c3a4e0) (BuildId: 982a4d5f82e76e5d)
1: 
1: AddressSanitizer can not provide additional info.
1: SUMMARY: AddressSanitizer: SEGV /build/reproducible-path/gcc-14-14.2.0/build/x86_64-linux-gnu/libstdc++-v3/libsupc++/../../../../src/libstdc++-v3/libsupc++/dyncast.cc:71:21 in __dynamic_cast
1: ==15044==ABORTING
1/1 Test #1: test .............................Subprocess aborted***Exception:   2.70 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   2.70 sec

The following tests FAILED:
          1 - test (Subprocess aborted)
Errors while running CTest
Output from these tests are in: /repositories/minizinc-meta/gecode/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants