Martchus / cpp-utilities

Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
GNU General Public License v2.0
52 stars 18 forks source link

Arch Build failing #19

Closed duckunix closed 3 years ago

duckunix commented 3 years ago

x86_64, Arch fully up-to-date before running install. I get the following errors:

==> Starting check()...
[0/1] cd /home/don/.cache/yay/c++utilities/src/cpp-utilities-5.10.2 && /usr/bin/ctest -V
UpdateCTestConfiguration  from :/home/don/.cache/yay/c++utilities/src/cpp-utilities-5.10.2/DartConfiguration.tcl
UpdateCTestConfiguration  from :/home/don/.cache/yay/c++utilities/src/cpp-utilities-5.10.2/DartConfiguration.tcl
Test project /home/don/.cache/yay/c++utilities/src/cpp-utilities-5.10.2
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: c++utilities_run_tests

1: Test command: /home/don/.cache/yay/c++utilities/src/cpp-utilities-5.10.2/c++utilities_tests
1: Test timeout computed to be: 10000000
1: /home/don/.cache/yay/c++utilities/src/cpp-utilities-5.10.2/testfiles/
1: ./testfiles/
1: Directory used to store working copies:
1: ./testfiles/workingdir/
1: Executing test cases ...
1: .................
1: output for formatting with ANSI escape codes:
1: Error: some error
1: Warning: some warning
1: Info: some info
1: ==> ERROR: Arch-style error
1: ==> WARNING: Arch-style warning
1:     Arch-style message
1: ==> Arch-style success
1:   -> Arch-style sub-message
1: blue, blinking text on red background
1: ---------------------------------------------
1: ............
1/1 Test #1: c++utilities_run_tests ...........Subprocess aborted***Exception:   0.08 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.08 sec

The following tests FAILED:
          1 - c++utilities_run_tests (Subprocess aborted)
Errors while running CTest
Output from these tests are in: /home/don/.cache/yay/c++utilities/src/cpp-utilities-5.10.2/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
FAILED: CMakeFiles/check 
cd /home/don/.cache/yay/c++utilities/src/cpp-utilities-5.10.2 && /usr/bin/ctest -V
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in check().
    Aborting...
Martchus commented 3 years ago

I've only seen this when building for Fedora so far (and since this build is only conduced on OBS I couldn't figure out what's wrong). It would be useful to have a stack trace.

suiryc commented 3 years ago

Hi, same issue here. Test case of Debug build says this:

Executing test cases ...
.................
output for formatting with ANSI escape codes:
Error: some error
Warning: some warning
Info: some info
==> ERROR: Arch-style error
==> WARNING: Arch-style warning
    Arch-style message
==> Arch-style success
  -> Arch-style sub-message
blue, blinking text on red background
---------------------------------------------
............/usr/include/c++/10.2.0/bits/basic_string.h:1038: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference = char&; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]: Assertion '__pos <= size()' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff7b97ef5 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7b97ef5 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff7b81862 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff7f3489a in std::__replacement_assert (__file=__file@entry=0x7ffff7f4f530 "/usr/include/c++/10.2.0/bits/basic_string.h", __line=__line@entry=1038,
    __function=__function@entry=0x7ffff7f4f378 "std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _Ch"..., __condition=__condition@entry=0x7ffff7f4f018 "__pos <= size()")
    at /usr/include/c++/10.2.0/x86_64-pc-linux-gnu/bits/c++config.h:457
#3  0x00007ffff7f2cf95 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[] (__pos=<optimized out>, this=0x7fffffffc900)
    at /usr/include/c++/10.2.0/bits/basic_string.h:1038
#4  0x00007ffff7f33a8f in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[] (__pos=<optimized out>, this=0x7fffffffc900)
    at /usr/include/c++/10.2.0/bits/basic_string.h:313
#5  CppUtilities::ArgumentParser::printBashCompletion (this=this@entry=0x7fffffffd810, argc=argc@entry=1, argv=argv@entry=0x7fffffffcac8,
    currentWordIndex=currentWordIndex@entry=0, reader=...) at application/argumentparser.cpp:1514
#6  0x00005555555cd764 in ArgumentParserTests::testBashCompletion (this=0x7fffffffca80) at tests/argumentparsertests.cpp:548
#7  0x00007ffff7f827d1 in CppUnit::TestCaseMethodFunctor::operator()() const () from /usr/lib/libcppunit-1.15.so.1
#8  0x00007ffff7f790d1 in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) () from /usr/lib/libcppunit-1.15.so.1
#9  0x00007ffff7f7ff78 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) () from /usr/lib/libcppunit-1.15.so.1
#10 0x00007ffff7f8a1f7 in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/libcppunit-1.15.so.1
#11 0x00007ffff7f8256d in CppUnit::TestCase::run(CppUnit::TestResult*) () from /usr/lib/libcppunit-1.15.so.1
#12 0x00007ffff7f82b03 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) () from /usr/lib/libcppunit-1.15.so.1
#13 0x00007ffff7f82c69 in CppUnit::TestComposite::run(CppUnit::TestResult*) () from /usr/lib/libcppunit-1.15.so.1
#14 0x00007ffff7f82b03 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) () from /usr/lib/libcppunit-1.15.so.1
#15 0x00007ffff7f82c69 in CppUnit::TestComposite::run(CppUnit::TestResult*) () from /usr/lib/libcppunit-1.15.so.1
#16 0x00007ffff7f89873 in CppUnit::TestResult::runTest(CppUnit::Test*) () from /usr/lib/libcppunit-1.15.so.1
#17 0x00007ffff7f8c240 in CppUnit::TestRunner::run(CppUnit::TestResult&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
   from /usr/lib/libcppunit-1.15.so.1
#18 0x00007ffff7f8e012 in CppUnit::TextTestRunner::run(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, bool, bool) ()
   from /usr/lib/libcppunit-1.15.so.1
#19 0x00005555555878a2 in main (argc=<optimized out>, argv=<optimized out>) at tests/./cppunit.h:78

Oddly enough, on another computer the test case passes. In case the CPU matters: the computer where the test passes has an Intel i7-3610QM; the one where it fails has an AMD Ryzen 5 1600X.

Edit: running up-to-date ArchLinux too.

Martchus commented 3 years ago

It doesn't fail on any of my systems (which have various different CPUs) but I'll have a look at the functions the backtrace is pointing to. (I previously saw failures within my builds on OBS but couldn't debug them.)

suiryc commented 3 years ago

For information, the previous version (5.10.1) is ok: test case passes without crash. (but maybe the crash in 5.10.2 happens in a test that did not exist in 5.10.1)

Martchus commented 3 years ago

I pushed a commit which should fix this. The backtrace was very useful.

suiryc commented 3 years ago

It appears to be fixed indeed. Tried makepkg (AUR tool) to build from git sources: the test does now pass (and was still failing before the latest commit).

suiryc commented 3 years ago

No issue installing the latest 5.10.3-1 package on ArchLinux for me. Thank you for your tools, and the fix.

Martchus commented 3 years ago

Good. The crashes I've observed on OBS within the Fedora builds are gone as well. So I'm closing the issue.