Description
<!-- 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 -->
Compiled version 58ba7c314d552cea8cb024960a8504577aee586f with the following configure:
./configure --without-gui --with-incompatible-bdb
Launch bitcoind from the command line:
$ bitcoind
Crashes almost immediately. See trace below for more.
Note: can't reproduce the crash if I pass the -nowallet option
System information
bitcoin version: 58ba7c314d552cea8cb024960a8504577aee586f
Update: reproduced also in version cd1f5bf1db26801a6c266ea1237734ca5ba2c64c
OS: Ubuntu 18.04.4 LTS
<!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->
<!-- GUI-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell? -->
<!-- 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. -->
trace
(gdb) r
Starting program: /usr/local/bin/bitcoind
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
2020-04-19T17:17:56Z Bitcoin Core version v0.19.1 (release build)
2020-04-19T17:17:56Z Assuming ancestors of block 00000000000000000005f8920febd3925f8272a6a71237563d78c2edfdd09ddf have valid signatures.
2020-04-19T17:17:56Z Setting nMinimumChainWork=000000000000000000000000000000000000000008ea3cf107ae0dec57f03fe8
2020-04-19T17:17:56Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
2020-04-19T17:17:56Z Using RdSeed as additional entropy source
2020-04-19T17:17:56Z Using RdRand as an additional entropy source
2020-04-19T17:17:56Z Default data directory /home/dgabriele/.bitcoin
2020-04-19T17:17:56Z Using data directory /home/dgabriele/.bitcoin
2020-04-19T17:17:56Z Config file: /home/dgabriele/.bitcoin/bitcoin.conf (not found, skipping)
2020-04-19T17:17:56Z Using at most 125 automatic connections (1024 file descriptors available)
2020-04-19T17:17:56Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2020-04-19T17:17:56Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2020-04-19T17:17:56Z Using 8 threads for script verification
[New Thread 0x7ffff2ba4700 (LWP 6036)]
[New Thread 0x7ffff23a3700 (LWP 6037)]
[New Thread 0x7ffff1ba2700 (LWP 6038)]
[New Thread 0x7ffff13a1700 (LWP 6039)]
[New Thread 0x7ffff0ba0700 (LWP 6040)]
[New Thread 0x7fffe3fff700 (LWP 6041)]
[New Thread 0x7fffe37fe700 (LWP 6042)]
[New Thread 0x7fffe2ffd700 (LWP 6043)]
2020-04-19T17:17:56Z scheduler thread start
2020-04-19T17:17:56Z HTTP: creating work queue of depth 16
2020-04-19T17:17:56Z No rpcpassword set - using random cookie authentication.
2020-04-19T17:17:56Z Generated RPC authentication cookie /home/dgabriele/.bitcoin/.cookie
2020-04-19T17:17:56Z HTTP: starting 4 worker threads
[New Thread 0x7fffe27fc700 (LWP 6044)]
[New Thread 0x7fffe1ffb700 (LWP 6045)]
[New Thread 0x7fffe17fa700 (LWP 6046)]
[New Thread 0x7fffe0ff9700 (LWP 6047)]
[New Thread 0x7fffbffff700 (LWP 6048)]
2020-04-19T17:17:56Z Using wallet directory /home/dgabriele/.bitcoin/wallets
2020-04-19T17:17:56Z init message: Verifying wallet(s)...
2020-04-19T17:17:56Z Using BerkeleyDB version Berkeley DB 4.8.30: (April 9, 2010)
2020-04-19T17:17:56Z Using wallet /home/dgabriele/.bitcoin/wallets
2020-04-19T17:17:56Z BerkeleyEnvironment::Open: LogDir=/home/dgabriele/.bitcoin/wallets/database ErrorFile=/home/dgabriele/.bitcoin/wallets/db.log
Thread 1 "bitcoind" received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62
62 ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory.
(gdb) bt
[#0](/bitcoin-bitcoin/0/) __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62
[#1](/bitcoin-bitcoin/1/) 0x00007ffff7114672 in __os_strdup () from /usr/lib/libdb_cxx-4.8.so
[#2](/bitcoin-bitcoin/2/) 0x00007ffff70e7dc2 in __env_add_data_dir () from /usr/lib/libdb_cxx-4.8.so
[#3](/bitcoin-bitcoin/3/) 0x00007ffff70e7e91 in __env_set_data_dir () from /usr/lib/libdb_cxx-4.8.so
[#4](/bitcoin-bitcoin/4/) 0x00007ffff70068e9 in DbEnv::set_data_dir(char const*) () from /usr/lib/libdb_cxx-4.8.so
[#5](/bitcoin-bitcoin/5/) 0x000055555589ed62 in BerkeleyEnvironment::Open (this=0x555555f4b750, retry=retry@entry=true) at wallet/db.cpp:191
[#6](/bitcoin-bitcoin/6/) 0x00005555558a014c in BerkeleyBatch::VerifyEnvironment (file_path=..., errorStr="") at wallet/db.cpp:407
[#7](/bitcoin-bitcoin/7/) 0x0000555555880c0d in WalletBatch::VerifyEnvironment (wallet_path=..., errorStr="") at wallet/walletdb.cpp:729
[#8](/bitcoin-bitcoin/8/) 0x0000555555852cdb in CWallet::Verify (chain=..., location=..., salvage_wallet=salvage_wallet@entry=false, error_string="", warning_string="") at wallet/wallet.cpp:4274
[#9](/bitcoin-bitcoin/9/) 0x00005555557f3a43 in VerifyWallets (chain=..., wallet_files=...) at wallet/load.cpp:57
[#10](/bitcoin-bitcoin/10/) 0x00005555555b018f in AppInitMain (interfaces=...) at init.cpp:1311
[#11](/bitcoin-bitcoin/11/) 0x0000555555597f4b in AppInit (argc=<optimized out>, argv=<optimized out>) at bitcoind.cpp:146
[#12](/bitcoin-bitcoin/12/) 0x000055555558da7f in main (argc=1, argv=0x7fffffffdb28) at bitcoind.cpp:176