bitcoin / bitcoin

Bitcoin Core integration/staging tree

Home Page:https://bitcoincore.org/en/download

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segfault when running `make check` with gui package enabled on Ubuntu 21.04

willcl-ark opened this issue · comments

I am using Ubuntu 21.04 and have a system BDB installed (5.3): dpkg_bdbd.log and QT5: dpkg_qt.log.

Bitcoin source is at a098814 (tag v22.0)

make check runs successfully to completion when using

./contrib/install_db4.sh `pwd`
export BDB_PREFIX="/home/will/src/bitcoin/db4"
./autogen.sh
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" --without-gui
make check -j`nproc`

However, if I enable the gui package then it will fail with a segmentation fault inside a wallet test:

$ rg Error make_check.log
212:2021-11-05Tmake[3]: *** [Makefile:18087: wallet/test/psbt_wallet_tests.cpp.test] Error 1
3088:Error: A version conflict was detected between the run-time BerkeleyDB library and the one used during compilation.
3094:2021-11-05T10:16:58.271290Z [test] [noui.cpp:43] [noui_ThreadSafeMessageBox] Error: A version conflict was detected between the run-time BerkeleyDB library and the one used during compilation.
5964:Error: A version conflict was detected between the run-time BerkeleyDB library and the one used during compilation.
5970:2021-11-05T10:16:58.309941Z [test] [noui.cpp:43] [noui_ThreadSafeMessageBox] Error: A version conflict was detected between the run-time BerkeleyDB library and the one used during compilation.
8793:Error: A version conflict was detected between the run-time BerkeleyDB library and the one used during compilation.
8799:2021-11-05T10:16:58.333933Z [test] [noui.cpp:43] [noui_ThreadSafeMessageBox] Error: A version conflict was detected between the run-time BerkeleyDB library and the one used during compilation.
11533:Error: A version conflict was detected between the run-time BerkeleyDB library and the one used during compilation.
11539:2021-11-05T10:16:58.356529Z [test] [noui.cpp:43] [noui_ThreadSafeMessageBox] Error: A version conflict was detected between the run-time BerkeleyDB library and the one used during compilation.
11559:2021-11-05T10:16:58.357477Z [test] [txmempool.cpp:633] [check] Checking mempool with 0 make[3]: *** [Makefile:18086: wallet/test/wallet_tests.cpp.test] Error 1

make_check.log

config.log

This is causing make to hang indefinitely, but one time it ran (somewhat) to completion and wrote the following to test-suite.log (which is usually more empty than this, containing only up to FAIL):

=============================================
   Bitcoin Core 22.0.0: src/test-suite.log
=============================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: qt/test/test_bitcoin-qt
=============================

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
********* Start testing of AppTests *********
Config: Using QtTest library 5.15.2, Qt 5.15.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 10.3.0), ubuntu 21.04
PASS   : AppTests::initTestCase()
Error: A version conflict was detected between the run-time BerkeleyDB library and the one used during compilation.
QINFO  : AppTests::appTests() Backing up GUI settings to "/tmp/test_common_Bitcoin Core/321e4f587b345b4b1fb1314fd08629f45fc98e29e97937449a178d78d0cce606/regtest/guisettings.ini.bak"
Error: A version conflict was detected between the run-time BerkeleyDB library and the one used during compilation.
QWARN  : AppTests::appTests() This plugin does not support propagateSizeHints()

=== Received signal at function time: 300000ms, total time: 300000ms, dumping stack ===
GNU gdb (Ubuntu 10.1-2ubuntu2) 10.1.90.20210411-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 81650
(gdb) === End of stack trace ===
QFATAL : AppTests::appTests() Test function timed out
FAIL!  : AppTests::appTests() Received a fatal error.
   Loc: [Unknown file(0)]
Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 300048ms
********* Finished testing of AppTests *********
FAIL qt/test/test_bitcoin-qt (exit status: 134)

It is reproducible on my system currently, so let me know if there are any more pieces of info I can provide to help. I don't quite understand why BDB 5.3 is being touched at any point, despite them being system-installed...

commented

Do you want to compile with bdb 5.3 or 4.8?

  • If 5.3: Remove the 4.8 folder and don't pass it to configure
  • If 4.8: Would it be possible to uninstall 5.3 from the system?

Don't forget make distclean before the next configure.

@MarcoFalke Sorry I should have made that clear. I was rather hoping I could leave the (system) 5.3 installed, but compile bitcoin core with the self-contained and self-built 4.8 :)

I am running make distclean (and often git clean -dfX) before building at the moment until I get this fixed.

Removing package libdb5.3++ "solves" the issue. libdb5.3 is as expected a critical system package which should not be removed.

I ran make install (for the first time ever on this machine) and then reinstalled previously problematic system package libdb5.3++.

Now even with this package installed, both qt binaries (source dir and installed) work, and make check passes successfully as expected.

So all working now with the following libdb packages installed:

[I] [14:01] will:bitcoin (v22.0) | dpkg -l | grep 'libdb'
ii  libdb5.3:amd64                             5.3.28+dfsg1-0.6ubuntu4                                                      amd64        Berkeley v5.3 Database Libraries [runtime]
ii  libdb5.3++:amd64                           5.3.28+dfsg1-0.6ubuntu4                                                      amd64        Berkeley v5.3 

I'm not exactly sure what's changed, make install does not appear to install any runtime bdb files, so perhaps package installation order matters 🤷 This is a pretty fresh Ubuntu installation. If there's nothing to investigate further here, I'm happy to close.

commented

This is a pretty fresh Ubuntu installation.

I probably won't debug this build issue, but if you have steps to reproduce from a vanilla install, someone else might take a look.

Now even with this package installed ... work ...

Yes, as long as you compile without libdbd5.3++ available, I'd expect this behavior. This should even happen without make install, I'd guess.

Closing this for now as it seems most likely caused by some user misconfiguration