test_bitcoin: key.cpp:305: void ECC_Start(): Assertion `secp256k1_context_sign == NULL' failed. #8260

issue error10 opened this issue on June 25, 2016
  1. error10 commented at 5:25 AM on June 25, 2016: contributor

    I'm attempting to build Bitcoin 0.12.1 on Fedora 24, which includes GCC 6.1.1.

    While the code appears to build correctly, make check fails on test_bitcoin. The test-suite.log shows 85 test failures, all with this particular assertion failing. A representative sample:

    terminate called without an active exception
    Running 183 test cases...
    unknown location(0): fatal error: in "reverselock_tests/reverselock_errors": signal: SIGABRT (application abort requested)
    test/reverselock_tests.cpp(50): last checkpoint
    test_bitcoin: key.cpp:305: void ECC_Start(): Assertion `secp256k1_context_sign == NULL' failed.
    unknown location(0): fatal error: in "rpc_tests/rpc_rawparams": signal: SIGABRT (application abort requested)
    test/rpc_tests.cpp(53): last checkpoint: "rpc_rawparams" fixture entry.
    test_bitcoin: key.cpp:305: void ECC_Start(): Assertion `secp256k1_context_sign == NULL' failed.
    unknown location(0): fatal error: in "rpc_tests/rpc_rawsign": signal: SIGABRT (application abort requested)
    test/rpc_tests.cpp(95): last checkpoint: "rpc_rawsign" fixture entry.
    test_bitcoin: key.cpp:305: void ECC_Start(): Assertion `secp256k1_context_sign == NULL' failed.
    
    ...
    
    *** 85 failures are detected in the test module "Bitcoin Test Suite"
    FAIL test/test_bitcoin (exit status: 201)
    

    The failure occurs on both 32-bit and 64-bit. The 64-bit configuration is:

    '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-reduce-exports' '--enable-glibc-back-compat' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CXXFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' 'LDFLAGS=-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig' --disable-shared --with-pic --with-bignum=no --enable-module-recovery

    The 32-bit configuration is:

    '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-reduce-exports' '--enable-glibc-back-compat' 'build_alias=i686-redhat-linux-gnu' 'host_alias=i686-redhat-linux-gnu' 'CXXFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' 'LDFLAGS=-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' 'PKG_CONFIG_PATH=:/usr/lib/pkgconfig:/usr/share/pkgconfig' --disable-shared --with-pic --with-bignum=no --enable-module-recovery

  2. laanwj added the label Build system on Jun 25, 2016
  3. jonasschnelli commented at 8:24 PM on June 26, 2016: contributor

    Hm... for me it looks like that checked_malloc() (in libsecp256k1) could not call malloc(size).

  4. laanwj commented at 10:31 AM on June 27, 2016: member

    Hm... for me it looks like that checked_malloc() (in libsecp256k1) could not call malloc(size).

    Which would imply memory is full?

  5. error10 commented at 2:47 PM on June 27, 2016: contributor

    Hm... for me it looks like that checked_malloc() (in libsecp256k1) could not call malloc(size).

    Which would imply memory is full?

    The build VM in question has 4GB of RAM, 2GB of swap, and is hardly using any of it while the test runs. If this isn't enough memory to run the test, then it isn't nearly enough to run bitcoind itself (which it plainly is).

  6. sdaftuar commented at 2:54 PM on June 27, 2016: member

    I think the relevant issue here is probably this line:

    unknown location(0): fatal error: in "reverselock_tests/reverselock_errors": signal: SIGABRT (application abort requested)
    test/reverselock_tests.cpp(50): last checkpoint
    

    I have no idea what causes the later errors that start with ECC_Start()..., but I'm pretty sure that's a symptom of an earlier test failure.

  7. theuni commented at 5:28 AM on June 28, 2016: member

    Agreed with @sdaftuar. I get the ECC_Start() failures all the time when I accidentally break tests. That should be investigated separately, but I don't think it's the issue here.

    My guess is that there's a legitimate failure in the reverselock test due to something specific about this system.

  8. error10 commented at 1:24 AM on June 29, 2016: contributor

    I've run this test in isolation and it appears to be a problem:

    $ BOOST_TEST_LOG_LEVEL=test_suite ./test_bitcoin --run_test=reverselock_tests/reverselock_errors
    Running 1 test case...
    Entering test module "Bitcoin Test Suite"
    test/reverselock_tests.cpp(10): Entering test suite "reverselock_tests"
    test/reverselock_tests.cpp(25): Entering test case "reverselock_errors"
    terminate called without an active exception
    unknown location(0): fatal error: in "reverselock_tests/reverselock_errors": signal: SIGABRT (application abort requested)
    test/reverselock_tests.cpp(50): last checkpoint
    test/reverselock_tests.cpp(25): Leaving test case "reverselock_errors"; testing time: 347us
    test/reverselock_tests.cpp(10): Leaving test suite "reverselock_tests"; testing time: 353us
    Leaving test module "Bitcoin Test Suite"; testing time: 370us
    
    *** 1 failure is detected in the test module "Bitcoin Test Suite"
    

    What I don't have is a course of action. What do I do at this point?

  9. theuni commented at 3:06 AM on June 29, 2016: member

    Can you run the same thing under gdb? I think it'd be: gdb --args ./test_bitcoin --run_test=reverselock_tests/reverselock_errors

    then hit r to run, wait for it to crash, and thread apply all bt. Hopefully that should show a valid trace including the line causing terminate to be called. I'm suspecting test/reverselock_tests.cpp:52

  10. error10 commented at 3:46 AM on June 29, 2016: contributor

    There was only one thread:

    (gdb) run
    Starting program: /home/error/bitcoin-0.12.1/src/test/test_bitcoin --run_test=reverselock_tests/reverselock_errors
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib64/libthread_db.so.1".
    Running 1 test case...
    Entering test module "Bitcoin Test Suite"
    test/reverselock_tests.cpp(10): Entering test suite "reverselock_tests"
    test/reverselock_tests.cpp(25): Entering test case "reverselock_errors"
    test/reverselock_tests.cpp(33): info: check !lock.owns_lock() has passed
    test/reverselock_tests.cpp(42): info: check failed has passed
    test/reverselock_tests.cpp(43): info: check !lock.owns_lock() has passed
    test/reverselock_tests.cpp(50): info: check lock.owns_lock() has passed
    terminate called without an active exception
    
    Program received signal SIGABRT, Aborted.
    0x00007ffff55a36f5 in __GI_raise (sig=sig@entry=6)
        at ../sysdeps/unix/sysv/linux/raise.c:54
    54    return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
    (gdb) thread apply all bt
    
    Thread 1 (Thread 0x7ffff7fda840 (LWP 18693)):
    [#0](/bitcoin-bitcoin/0/)  0x00007ffff55a36f5 in __GI_raise (sig=sig@entry=6)
        at ../sysdeps/unix/sysv/linux/raise.c:54
    [#1](/bitcoin-bitcoin/1/)  0x00007ffff55a52fa in __GI_abort () at abort.c:89
    [#2](/bitcoin-bitcoin/2/)  0x00007ffff60ff3ed in __gnu_cxx::__verbose_terminate_handler ()
        at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
    [#3](/bitcoin-bitcoin/3/)  0x00007ffff60fd196 in __cxxabiv1::__terminate (handler=<optimized out>)
        at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47
    [#4](/bitcoin-bitcoin/4/)  0x00007ffff60fd1e1 in std::terminate ()
        at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57
    [#5](/bitcoin-bitcoin/5/)  0x00005555556b0fed in reverselock_tests::reverselock_errors::test_method (
        this=this@entry=0x7fffffffc64c) at ./reverselock.h:20
    [#6](/bitcoin-bitcoin/6/)  0x00005555556b235a in reverselock_tests::reverselock_errors_invoker ()
        at test/reverselock_tests.cpp:25
    [#7](/bitcoin-bitcoin/7/)  0x00007ffff70b6c4e in boost::function0<void>::operator() (
        this=<optimized out>) at boost/function/function_template.hpp:771
    [#8](/bitcoin-bitcoin/8/)  boost::detail::forward::operator() (this=<optimized out>)
        at boost/test/impl/execution_monitor.ipp:1304
    [#9](/bitcoin-bitcoin/9/)  boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke (function_obj_ptr=...) at boost/function/function_template.hpp:138
    [#10](/bitcoin-bitcoin/10/) 0x00007ffff70b637d in boost::function0<int>::operator() (
        this=0x7fffffffd610) at boost/function/function_template.hpp:771
    [#11](/bitcoin-bitcoin/11/) boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()> >(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) (F=..., tr=...)
        at boost/test/impl/execution_monitor.ipp:281
    [#12](/bitcoin-bitcoin/12/) boost::execution_monitor::catch_signals(boost::function<int ()> const&) (
        this=this@entry=0x7ffff7317c20 <boost::unit_test::singleton<boost::unit_test::unit_test_monitor_t>::instance()::the_inst>, F=...)
        at boost/test/impl/execution_monitor.ipp:870
    [#13](/bitcoin-bitcoin/13/) 0x00007ffff70b6478 in boost::execution_monitor::execute(boost::function<int ()> const&) (
        this=this@entry=0x7ffff7317c20 <boost::unit_test::singleton<boost::unit_test::unit_test_monitor_t>::instance()::the_inst>, F=...)
        at boost/test/impl/execution_monitor.ipp:1207
    [#14](/bitcoin-bitcoin/14/) 0x00007ffff70b6ac6 in boost::execution_monitor::vexecute(boost::function<void ()> const&) (
        this=this@entry=0x7ffff7317c20 <boost::unit_test::singleton<boost::unit_test::unit_test_monitor_t>::instance()::the_inst>, F=...)
        at boost/test/impl/execution_monitor.ipp:1313
    [#15](/bitcoin-bitcoin/15/) 0x00007ffff70d94cb in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned int) (
        this=0x7ffff7317c20 <boost::unit_test::singleton<boost::unit_test::unit_test_monitor_t>::instance()::the_inst>, func=..., timeout=timeout@entry=0)
        at boost/test/impl/unit_test_monitor.ipp:46
    [#16](/bitcoin-bitcoin/16/) 0x00007ffff70c1086 in boost::unit_test::framework::state::execute_test_tree
        (
        this=this@entry=0x7ffff73176c0 <boost::unit_test::framework::impl::(anonymous namespace)::s_frk_state()::the_inst>, tu_id=tu_id@entry=65634, timeout=0)
        at boost/test/impl/framework.ipp:691
    [#17](/bitcoin-bitcoin/17/) 0x00007ffff70c17c1 in boost::unit_test::framework::state::execute_test_tree
        (
        this=this@entry=0x7ffff73176c0 <boost::unit_test::framework::impl::(anonymous namespace)::s_frk_state()::the_inst>, tu_id=tu_id@entry=32, timeout=0)
        at boost/test/impl/framework.ipp:642
    [#18](/bitcoin-bitcoin/18/) 0x00007ffff70c17c1 in boost::unit_test::framework::state::execute_test_tree
        (
        this=0x7ffff73176c0 <boost::unit_test::framework::impl::(anonymous namespace)::s_frk_state()::the_inst>, tu_id=tu_id@entry=1, timeout=timeout@entry=0)
        at boost/test/impl/framework.ipp:642
    [#19](/bitcoin-bitcoin/19/) 0x00007ffff70bb581 in boost::unit_test::framework::run (id=1,
        id@entry=4294967295, continue_test=continue_test@entry=true)
        at boost/test/impl/framework.ipp:1230
    [#20](/bitcoin-bitcoin/20/) 0x00007ffff70d746f in boost::unit_test::unit_test_main (
        init_func=<optimized out>, argc=<optimized out>, argv=<optimized out>)
        at boost/test/impl/unit_test_main.ipp:229
    [#21](/bitcoin-bitcoin/21/) 0x00007ffff558f731 in __libc_start_main (
        main=0x555555598110 <main(int, char**)>, argc=2, argv=0x7fffffffe318,
        init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
        stack_end=0x7fffffffe308) at ../csu/libc-start.c:289
    [#22](/bitcoin-bitcoin/22/) 0x00005555555a3219 in _start ()
    (gdb)
    
  11. theuni commented at 4:19 PM on June 29, 2016: member

    @error10:

    Could you please try this patch? My best guess is that something about your setup is different than most. There's some undefined behavior in reverse_lock, and it looks like we've been relying on an exception to be thrown. This removes that undefined behavior:

    Author: Cory Fields <cory-nospam-@coryfields.com>
    Date:   Wed Jun 29 11:54:13 2016 -0400
    
        reverselock: unlocking is undefined if the mutex is not locked
    
        Explicitly throw an exception in reverselock instead, rather than defaulting to
        the mutex's failure behavior, which may be to call terminate.
    
    diff --git a/src/reverselock.h b/src/reverselock.h
    index fac1ccb..10af137 100644
    --- a/src/reverselock.h
    +++ b/src/reverselock.h
    @@ -5,6 +5,8 @@
     #ifndef BITCOIN_REVERSELOCK_H
     #define BITCOIN_REVERSELOCK_H
    
    +#include <stdexcept>
    +
     /**
      * An RAII-style reverse lock. Unlocks on construction and locks on destruction.
      */
    @@ -14,6 +16,8 @@ class reverse_lock
     public:
    
         explicit reverse_lock(Lock& lock) : lock(lock) {
    +        if(!lock.owns_lock())
    +            throw std::runtime_error("failed to unlock mutex for lock");
             lock.unlock();
             lock.swap(templock);
         }
    
  12. error10 commented at 4:56 PM on June 29, 2016: contributor

    @theuni This patch doesn't seem to have had any effect. The tests still fail with substantially the same backtrace as before.

    (gdb) run
    Starting program: /home/error/bitcoin-0.12.1/src/test/test_bitcoin --run_test=reverselock_tests/reverselock_errors
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib64/libthread_db.so.1".
    Running 1 test case...
    Entering test module "Bitcoin Test Suite"
    test/reverselock_tests.cpp(10): Entering test suite "reverselock_tests"
    test/reverselock_tests.cpp(25): Entering test case "reverselock_errors"
    test/reverselock_tests.cpp(33): info: check !lock.owns_lock() has passed
    test/reverselock_tests.cpp(42): info: check failed has passed
    test/reverselock_tests.cpp(43): info: check !lock.owns_lock() has passed
    test/reverselock_tests.cpp(50): info: check lock.owns_lock() has passed
    terminate called without an active exception
    
    Program received signal SIGABRT, Aborted.
    0x00007ffff55a36f5 in __GI_raise (sig=sig@entry=6)
        at ../sysdeps/unix/sysv/linux/raise.c:54
    54    return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
    (gdb) thread apply all bt
    
    Thread 1 (Thread 0x7ffff7fda840 (LWP 22096)):
    [#0](/bitcoin-bitcoin/0/)  0x00007ffff55a36f5 in __GI_raise (sig=sig@entry=6)
        at ../sysdeps/unix/sysv/linux/raise.c:54
    [#1](/bitcoin-bitcoin/1/)  0x00007ffff55a52fa in __GI_abort () at abort.c:89
    [#2](/bitcoin-bitcoin/2/)  0x00007ffff60ff3ed in __gnu_cxx::__verbose_terminate_handler ()
        at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
    [#3](/bitcoin-bitcoin/3/)  0x00007ffff60fd196 in __cxxabiv1::__terminate (handler=<optimized out>)
        at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:47
    [#4](/bitcoin-bitcoin/4/)  0x00007ffff60fd1e1 in std::terminate ()
        at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:57
    [#5](/bitcoin-bitcoin/5/)  0x00005555556b0f57 in reverselock_tests::reverselock_errors::test_method (
        this=this@entry=0x7fffffffc67c) at ./reverselock.h:24
    [#6](/bitcoin-bitcoin/6/)  0x00005555556b227a in reverselock_tests::reverselock_errors_invoker ()
        at test/reverselock_tests.cpp:25
    [#7](/bitcoin-bitcoin/7/)  0x00007ffff70b6c4e in boost::function0<void>::operator() (
        this=<optimized out>) at boost/function/function_template.hpp:771
    [#8](/bitcoin-bitcoin/8/)  boost::detail::forward::operator() (this=<optimized out>)
        at boost/test/impl/execution_monitor.ipp:1304
    [#9](/bitcoin-bitcoin/9/)  boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke (function_obj_ptr=...) at boost/function/function_template.hpp:138
    [#10](/bitcoin-bitcoin/10/) 0x00007ffff70b637d in boost::function0<int>::operator() (
        this=0x7fffffffd640) at boost/function/function_template.hpp:771
    [#11](/bitcoin-bitcoin/11/) boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()> >(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) (F=..., tr=...)
        at boost/test/impl/execution_monitor.ipp:281
    [#12](/bitcoin-bitcoin/12/) boost::execution_monitor::catch_signals(boost::function<int ()> const&) (
        this=this@entry=0x7ffff7317c20 <boost::unit_test::singleton<boost::unit_test::unit_test_monitor_t>::instance()::the_inst>, F=...)
        at boost/test/impl/execution_monitor.ipp:870
    [#13](/bitcoin-bitcoin/13/) 0x00007ffff70b6478 in boost::execution_monitor::execute(boost::function<int ()> const&) (
        this=this@entry=0x7ffff7317c20 <boost::unit_test::singleton<boost::unit_test::unit_test_monitor_t>::instance()::the_inst>, F=...)
        at boost/test/impl/execution_monitor.ipp:1207
    [#14](/bitcoin-bitcoin/14/) 0x00007ffff70b6ac6 in boost::execution_monitor::vexecute(boost::function<void ()> const&) (
        this=this@entry=0x7ffff7317c20 <boost::unit_test::singleton<boost::unit_test::unit_test_monitor_t>::instance()::the_inst>, F=...)
        at boost/test/impl/execution_monitor.ipp:1313
    [#15](/bitcoin-bitcoin/15/) 0x00007ffff70d94cb in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned int) (
        this=0x7ffff7317c20 <boost::unit_test::singleton<boost::unit_test::unit_test_monitor_t>::instance()::the_inst>, func=..., timeout=timeout@entry=0)
        at boost/test/impl/unit_test_monitor.ipp:46
    [#16](/bitcoin-bitcoin/16/) 0x00007ffff70c1086 in boost::unit_test::framework::state::execute_test_tree
        (
        this=this@entry=0x7ffff73176c0 <boost::unit_test::framework::impl::(anonymous namespace)::s_frk_state()::the_inst>, tu_id=tu_id@entry=65634, timeout=0)
        at boost/test/impl/framework.ipp:691
    [#17](/bitcoin-bitcoin/17/) 0x00007ffff70c17c1 in boost::unit_test::framework::state::execute_test_tree
        (
        this=this@entry=0x7ffff73176c0 <boost::unit_test::framework::impl::(anonymous namespace)::s_frk_state()::the_inst>, tu_id=tu_id@entry=32, timeout=0)
        at boost/test/impl/framework.ipp:642
    [#18](/bitcoin-bitcoin/18/) 0x00007ffff70c17c1 in boost::unit_test::framework::state::execute_test_tree
        (
        this=0x7ffff73176c0 <boost::unit_test::framework::impl::(anonymous namespace)::s_frk_state()::the_inst>, tu_id=tu_id@entry=1, timeout=timeout@entry=0)
        at boost/test/impl/framework.ipp:642
    [#19](/bitcoin-bitcoin/19/) 0x00007ffff70bb581 in boost::unit_test::framework::run (id=1, 
        id@entry=4294967295, continue_test=continue_test@entry=true)
        at boost/test/impl/framework.ipp:1230
    [#20](/bitcoin-bitcoin/20/) 0x00007ffff70d746f in boost::unit_test::unit_test_main (
        init_func=<optimized out>, argc=<optimized out>, argv=<optimized out>)
        at boost/test/impl/unit_test_main.ipp:229
    [#21](/bitcoin-bitcoin/21/) 0x00007ffff558f731 in __libc_start_main (
        main=0x555555598110 <main(int, char**)>, argc=2, argv=0x7fffffffe348, 
        init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
        stack_end=0x7fffffffe338) at ../csu/libc-start.c:289
    [#22](/bitcoin-bitcoin/22/) 0x00005555555a3219 in _start ()
    (gdb) 
    
  13. error10 commented at 11:35 PM on June 29, 2016: contributor

    As I said at the very beginning, the big difference is that the system is using gcc 6.1.1.

    I just installed a debian stretch VM, and compiled bitcoin with the version of gcc-5 it came with (5.3.1). It worked fine and all tests passed. When I switched that system to gcc-6 (6.1.1) and rebuilt bitcoin I got the test failure again.

    (gdb) run
    Starting program: /home/error/bitcoin-0.12.1/src/test/test_bitcoin --run_test=reverselock_tests/reverselock_errors
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Running 1 test case...
    Entering test module "Bitcoin Test Suite"
    test/reverselock_tests.cpp(10): Entering test suite "reverselock_tests"
    test/reverselock_tests.cpp(25): Entering test case "reverselock_errors"
    test/reverselock_tests.cpp(33): info: check !lock.owns_lock() has passed
    test/reverselock_tests.cpp(42): info: check failed has passed
    test/reverselock_tests.cpp(43): info: check !lock.owns_lock() has passed
    test/reverselock_tests.cpp(50): info: check lock.owns_lock() has passed
    terminate called without an active exception
    
    Program received signal SIGABRT, Aborted.
    0x00007ffff5580458 in __GI_raise (sig=sig@entry=6)
        at ../sysdeps/unix/sysv/linux/raise.c:55
    55  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
    (gdb) thread apply all bt
    
    Thread 1 (Thread 0x7ffff7fce740 (LWP 23759)):
    [#0](/bitcoin-bitcoin/0/)  0x00007ffff5580458 in __GI_raise (sig=sig@entry=6)
        at ../sysdeps/unix/sysv/linux/raise.c:55
    [#1](/bitcoin-bitcoin/1/)  0x00007ffff55818da in __GI_abort () at abort.c:89
    [#2](/bitcoin-bitcoin/2/)  0x00007ffff60b2f6d in __gnu_cxx::__verbose_terminate_handler() ()
       from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    [#3](/bitcoin-bitcoin/3/)  0x00007ffff60b0f36 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    [#4](/bitcoin-bitcoin/4/)  0x00007ffff60b0f81 in std::terminate() ()
       from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    [#5](/bitcoin-bitcoin/5/)  0x00005555556b0bed in reverselock_tests::reverselock_errors::test_method (
        this=this@entry=0x7fffffffcb6c) at ./reverselock.h:20
    [#6](/bitcoin-bitcoin/6/)  0x00005555556b1f5a in reverselock_tests::reverselock_errors_invoker ()
        at test/reverselock_tests.cpp:25
    [#7](/bitcoin-bitcoin/7/)  0x00007ffff70a152c in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) ()
       from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.60.0
    [#8](/bitcoin-bitcoin/8/)  0x00007ffff70a0b6d in boost::execution_monitor::catch_signals(boost::function<int ()> const&) ()
       from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.60.0
    [#9](/bitcoin-bitcoin/9/)  0x00007ffff70a0c58 in boost::execution_monitor::execute(boost::function<int ()> const&) ()
       from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.60.0
    [#10](/bitcoin-bitcoin/10/) 0x00007ffff70a12a6 in boost::execution_monitor::vexecute(boost::function<void ()> const&) ()
       from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.60.0
    [#11](/bitcoin-bitcoin/11/) 0x00007ffff70c95db in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned int) ()
       from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.60.0
    [#12](/bitcoin-bitcoin/12/) 0x00007ffff70aa316 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned int) ()
       from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.60.0
    [#13](/bitcoin-bitcoin/13/) 0x00007ffff70aa598 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned int) ()
       from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.60.0
    [#14](/bitcoin-bitcoin/14/) 0x00007ffff70a4438 in boost::unit_test::framework::run(unsigned long, bool)
        () from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.60.0
    [#15](/bitcoin-bitcoin/15/) 0x00007ffff70c740f in boost::unit_test::unit_test_main(bool (*)(), int, char**) () from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.60.0
    [#16](/bitcoin-bitcoin/16/) 0x00007ffff556d5f0 in __libc_start_main (
        main=0x555555597d10 <main(int, char**)>, argc=2, argv=0x7fffffffe5f8, 
        init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
        stack_end=0x7fffffffe5e8) at libc-start.c:291
    [#17](/bitcoin-bitcoin/17/) 0x00005555555a2e19 in _start ()
    (gdb) 
    
  14. laanwj commented at 8:14 AM on June 30, 2016: member

    Could this be another C++ ABI incompatibility? I suppose boost is compiled with gcc 5.x on that system, while you are compiling bitcoin with gcc 6.x.

    You could try doing a depends build to rule that out:

    make distclean
    cd depends
    make -j4 NO_QT=1 NO_WALLET=1 NO_UPNP=1 # disable everything we just want boost
    cd ..
    ./configure --prefix=$PWD/x86_64-unknown-linux-gnu
    make
    make check
    
  15. theuni commented at 10:28 PM on July 6, 2016: member

    @laanwj Sounds reasonable. It's also possible that there's an issue with building as c++14 (remember that gcc6 defaults to that).

  16. jonasschnelli commented at 6:43 PM on July 7, 2016: contributor

    Today on IRC #bitcoin-dev:

    [16:42:02]  <earlz> Is there a reason that tests would be failing (for 0.12) on Arch Linux?
    [16:42:54]  <earlz> errors about secp256k1_context_sign not being null
    
  17. laanwj commented at 6:34 AM on July 8, 2016: member

    @laanwj Sounds reasonable. It's also possible that there's an issue with building as c++14 (remember that gcc6 defaults to that).

    Yes in that case boost is built with c++14 and Bitcoin Core with c++11 as we set the standard, which may also result in incompatibilities. Flashback to the libc/glibc days where compatibility broke all around the place all the time.

    errors about secp256k1_context_sign not being null

    We should really get rid of that error if another test fails, this gets us useless reports as no one will look further than the last error message and blame libsecp256.

  18. Earlz commented at 1:19 AM on July 20, 2016: contributor

    I've been following this issue and it's pretty annoying and I'm seeing no easy way around it. The strange thing is that the master branch builds and tests fine, it's only the 0.12 branch that has this problem.

    Also I tried @laanwj's build process, but it didn't make any difference for me.

  19. error10 commented at 12:36 AM on July 28, 2016: contributor

    I can confirm that this issue is not present in 0.13.0rc1. My guess is that some bit of the ongoing C++11 work fixed it.

  20. error10 commented at 4:53 AM on August 24, 2016: contributor

    Fixed in 0.13.0.

  21. error10 closed this on Aug 24, 2016

  22. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me