make check fails for configure option --with-incompatible-bdb and Berkeley DB 5.3 #13316

issue mustitz opened this issue on May 24, 2018
  1. mustitz commented at 5:07 PM on May 24, 2018: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    Running command “make check” fails if configure option “--with-incompatible-bdb” is set for Berkeley DB 5.3. It works fine with Berkeley DB 4.8 and without --with-incompatible-bdb option.

    <!--- What behavior did you expect? -->

    I expect that all tests will be passed during “make check” command.

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    But I received

    Entering test suite "Bitcoin Test Suite"
    Entering test suite "accounting_tests"
    Entering test case "acc_orderupgrade"
    unknown location(0): fatal error in "acc_orderupgrade": memory access violation at address: 0x00000001: no mapping at fault address
    Test is aborted
    Leaving test case "acc_orderupgrade"; testing time: 12963mks
    Leaving test suite "accounting_tests"
    Leaving test suite "Bitcoin Test Suite"
    terminate called after throwing an instance of '
    boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
    *** 1 failure detected in test suite "Bitcoin Test Suite"
      what():  boost: mutex lock failed in pthread_mutex_lock: Invalid argument
    Makefile:10248: recipe for target 'wallet/test/accounting_tests.cpp.test' failed
    

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    Step to reproduce:

    ./autogen.sh
    ./configure --with-incompatible-bdb --with-miniupnpc --enable-upnp-default --without-gui
    make
    make check
    

    or just run

    ./src/tests
    

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    I am using master branch, the HEAD is

    $ git show HEAD
    commit 6378eef18f618620e7226765339fd4c9c1349174 (HEAD -> master, origin/master, origin/HEAD)
    Merge: 5c41b6008 80b4910f7
    Author: Wladimir J. van der Laan <laanwj@gmail.com>
    Date:   Thu May 24 11:29:07 2018 +0200
    
        Merge [#13063](/bitcoin-bitcoin/13063/): Use shared pointer to retain wallet instance
    

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    Machine configuration is

    $ lsb_release -a
    No LSB modules are available.
    Distributor ID:	Ubuntu
    Description:	Ubuntu 16.04.4 LTS
    Release:	16.04
    Codename:	xenial
    
    

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

    GDB session is

    Thread 1 "test_bitcoin" received signal SIGSEGV, Segmentation fault.
    strlen () at ../sysdeps/x86_64/strlen.S:106
    106	../sysdeps/x86_64/strlen.S: No such file or directory.
    (gdb) bt
    [#0](/bitcoin-bitcoin/0/)  strlen () at ../sysdeps/x86_64/strlen.S:106
    [#1](/bitcoin-bitcoin/1/)  0x00007ffff69c0612 in __os_strdup () from /usr/lib/libdb_cxx-4.8.so
    [#2](/bitcoin-bitcoin/2/)  0x00007ffff6992be4 in __env_add_data_dir () from /usr/lib/libdb_cxx-4.8.so
    [#3](/bitcoin-bitcoin/3/)  0x00007ffff6992cb1 in __env_set_data_dir () from /usr/lib/libdb_cxx-4.8.so
    [#4](/bitcoin-bitcoin/4/)  0x00007ffff68ad62e in DbEnv::set_data_dir(char const*) () from /usr/lib/libdb_cxx-4.8.so
    [#5](/bitcoin-bitcoin/5/)  0x000055555585f25d in BerkeleyEnvironment::MakeMock (this=0x555557cf6c10) at wallet/db.cpp:210
    [#6](/bitcoin-bitcoin/6/)  0x00005555555cc732 in BerkeleyDatabase::BerkeleyDatabase (mock=true, wallet_path=..., this=0x555557928fa0) at ./wallet/db.h:112
    [#7](/bitcoin-bitcoin/7/)  MakeUnique<BerkeleyDatabase, char const (&) [1], bool>(char const (&) [1], bool&&) () at ./util.h:328
    [#8](/bitcoin-bitcoin/8/)  0x00005555555c7010 in BerkeleyDatabase::CreateMock () at ./wallet/db.h:131
    [#9](/bitcoin-bitcoin/9/)  WalletTestingSetup::WalletTestingSetup (this=0x7fffffffc640, chainName=...) at wallet/test/wallet_test_fixture.cpp:11
    [#10](/bitcoin-bitcoin/10/) 0x0000555555838fce in accounting_tests::acc_orderupgrade::acc_orderupgrade (this=0x7fffffffc640) at wallet/test/accounting_tests.cpp:29
    [#11](/bitcoin-bitcoin/11/) accounting_tests::acc_orderupgrade_invoker () at wallet/test/accounting_tests.cpp:29
    [#12](/bitcoin-bitcoin/12/) 0x00005555555ed877 in boost::unit_test::ut_detail::invoker<boost::unit_test::ut_detail::unused>::invoke<void (*)()> (this=<optimized out>, f=<optimized out>)
        at /usr/include/boost/test/utils/callback.hpp:56
    [#13](/bitcoin-bitcoin/13/) boost::unit_test::ut_detail::callback0_impl_t<boost::unit_test::ut_detail::unused, void (*)()>::invoke (this=<optimized out>) at /usr/include/boost/test/utils/callback.hpp:89
    [#14](/bitcoin-bitcoin/14/) 0x00007ffff70cecb1 in ?? () from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.58.0
    [#15](/bitcoin-bitcoin/15/) 0x00007ffff70ae996 in boost::execution_monitor::catch_signals(boost::unit_test::callback0<int> const&) () from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.58.0
    [#16](/bitcoin-bitcoin/16/) 0x00007ffff70af1b3 in boost::execution_monitor::execute(boost::unit_test::callback0<int> const&) () from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.58.0
    [#17](/bitcoin-bitcoin/17/) 0x00007ffff70cede2 in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::unit_test::test_case const&) () from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.58.0
    [#18](/bitcoin-bitcoin/18/) 0x00007ffff70b609e in boost::unit_test::framework_impl::visit(boost::unit_test::test_case const&) () from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.58.0
    [#19](/bitcoin-bitcoin/19/) 0x00007ffff70ec4cb in boost::unit_test::traverse_test_tree(boost::unit_test::test_suite const&, boost::unit_test::test_tree_visitor&) ()
       from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.58.0
    [#20](/bitcoin-bitcoin/20/) 0x00007ffff70ec4cb in boost::unit_test::traverse_test_tree(boost::unit_test::test_suite const&, boost::unit_test::test_tree_visitor&) ()
       from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.58.0
    [#21](/bitcoin-bitcoin/21/) 0x00007ffff70b19f6 in boost::unit_test::framework::run(unsigned long, bool) () from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.58.0
    [#22](/bitcoin-bitcoin/22/) 0x00007ffff70cd287 in boost::unit_test::unit_test_main(bool (*)(), int, char**) () from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.58.0
    [#23](/bitcoin-bitcoin/23/) 0x00007ffff53be830 in __libc_start_main (main=0x555555593900 <main(int, char**)>, argc=1, argv=0x7fffffffdc58, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
        stack_end=0x7fffffffdc48) at ../csu/libc-start.c:291
    [#24](/bitcoin-bitcoin/24/) 0x00005555555b8fd9 in _start ()
    (gdb) frame 5
    [#5](/bitcoin-bitcoin/5/)  0x000055555585f25d in BerkeleyEnvironment::MakeMock (this=0x555557cf6c10) at wallet/db.cpp:210
    210	    dbenv->set_cachesize(1, 0, 1);
    (gdb) l
    205	
    206	    boost::this_thread::interruption_point();
    207	
    208	    LogPrint(BCLog::DB, "BerkeleyEnvironment::MakeMock\n");
    209	
    210	    dbenv->set_cachesize(1, 0, 1);
    211	    dbenv->set_lg_bsize(10485760 * 4);
    212	    dbenv->set_lg_max(10485760);
    213	    dbenv->set_lk_max_locks(10000);
    214	    dbenv->set_lk_max_objects(10000);
    (gdb) p dbenv
    $1 = {
      _M_t = {<std::_Tuple_impl<0ul, DbEnv*, std::default_delete<DbEnv> >> = {<std::_Tuple_impl<1ul, std::default_delete<DbEnv> >> = {<std::_Head_base<1ul, std::default_delete<DbEnv>, true>> = {<std::default_delete<DbEnv>> = {<No data fields>}, <No data fields>}, <No data fields>}, <std::_Head_base<0ul, DbEnv*, false>> = {_M_head_impl = 0x555556fd8130}, <No data fields>}, <No data fields>}}
    
    
  2. NickSiena commented at 7:48 PM on May 24, 2018: none
  3. MarcoFalke commented at 8:24 PM on May 24, 2018: member

    @mustitz Your bt indicates bdb4.8, but the issue title suggests 5.3

    Could you please do a make distclean and fresh compile (safe the config log) and try again?

  4. MarcoFalke added the label Questions and Help on May 24, 2018
  5. mustitz commented at 9:23 AM on May 25, 2018: none

    Yes it looks like the main problem was in conflicts between bdb 4.8 and 5.3 which both were installed on my PC:

    # dpkg -l | grep 'libdb'
    ii  gir1.2-dbusmenu-glib-0.4:amd64                16.04.1+16.04.20160927-0ubuntu1              amd64        typelib file for libdbusmenu-glib4
    ii  libdb++-dev:amd64                             1:5.3.21~exp1ubuntu2                         amd64        Berkeley Database Libraries for C++ [development]
    ii  libdb-dev:amd64                               1:5.3.21~exp1ubuntu2                         amd64        Berkeley Database Libraries [development]
    ii  libdb4.8                                      4.8.30-xenial4                               amd64        Berkeley v4.8 Database Libraries [runtime]
    ii  libdb4.8++                                    4.8.30-xenial4                               amd64        Berkeley v4.8 Database Libraries for C++ [runtime]
    ii  libdb5.3:amd64                                5.3.28-11ubuntu0.1                           amd64        Berkeley v5.3 Database Libraries [runtime]
    ii  libdb5.3++:amd64                              5.3.28-11ubuntu0.1                           amd64        Berkeley v5.3 Database Libraries for C++ [runtime]
    ii  libdb5.3++-dev                                5.3.28-11ubuntu0.1                           amd64        Berkeley v5.3 Database Libraries for C++ [development]
    ii  libdb5.3-dev                                  5.3.28-11ubuntu0.1                           amd64        Berkeley v5.3 Database Libraries [development]
    ii  libdbus-1-3:amd64                             1.10.6-1ubuntu3.3                            amd64        simple interprocess messaging system (library)
    ii  libdbus-glib-1-2:amd64                        0.106-1                                      amd64        simple interprocess messaging system (GLib-based shared library)
    ii  libdbusmenu-glib4:amd64                       16.04.1+16.04.20160927-0ubuntu1              amd64        library for passing menus over DBus
    ii  libdbusmenu-gtk3-4:amd64                      16.04.1+16.04.20160927-0ubuntu1              amd64        library for passing menus over DBus - GTK+ version
    ii  libdbusmenu-gtk4:amd64                        16.04.1+16.04.20160927-0ubuntu1              amd64        library for passing menus over DBus - GTK+ version
    ii  libdbusmenu-qt2:amd64                         0.9.3+16.04.20160218-0ubuntu1                amd64        Qt implementation of the DBusMenu protocol
    ii  libdbusmenu-qt5:amd64                         0.9.3+16.04.20160218-0ubuntu1                amd64        Qt5 implementation of the DBusMenu protocol
    

    After complete purging of 4.8:

    # apt purge libdb4.8 libdb4.8++
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages will be REMOVED:
      bitcoind* libdb4.8* libdb4.8++*
    0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
    After this operation, 9,968 kB disk space will be freed.
    Do you want to continue? [Y/n] 
    (Reading database ... 426861 files and directories currently installed.)
    Removing bitcoind (0.16.0-xenial1) ...
    Removing libdb4.8 (4.8.30-xenial4) ...
    Removing libdb4.8++ (4.8.30-xenial4) ...
    Processing triggers for man-db (2.7.5-1) ...
    

    everything is working fine. Thanks to @MarcoFalke and @TheMacNerd

    P. S. Usually I used even git clean -fdx to clean between comilations if some extra packages were added/removed.

    P. P. S. Thanks @MarcoFalke It was a good way to combine both bdb version on one PC.

  6. mustitz closed this on May 25, 2018

  7. 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-13 18:15 UTC

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