profile
viewpoint

Ask questionsmacOS: crash while loading wallet with berkeley-db@4

On macOS 10.14.4 with Homebrew berkeley-db@4 4.8.30 using master (4f4ef3138b06b405d9d8877ddc4a3492a2512c41) bitcoind crashes when loading an existing wallet or creating a new one.

2019-04-15T10:28:15Z init message: Verifying wallet(s)...
2019-04-15T10:28:15Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2019-04-15T10:28:15Z Using wallet /Users/bitcoin/Library/Application Support/Bitcoin/testnet3/wallets/A
2019-04-15T10:28:15Z BerkeleyEnvironment::Open: LogDir=/Users/bitcoin/Library/Application Support/Bitcoin/testnet3/wallets/A/database ErrorFile=/Users/bitcoin/Library/Application Support/Bitcoin/testnet3/wallets/A/db.log
Process 87520 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10000)
    frame #0: 0x0000000102445d8e libdb_cxx-4.8.dylib`__lock_get_lk_max_locks + 53
libdb_cxx-4.8.dylib`__lock_get_lk_max_locks:
->  0x102445d8e <+53>: movl   %eax, (%rsi)
    0x102445d90 <+55>: xorl   %eax, %eax
    0x102445d92 <+57>: popq   %rbp
    0x102445d93 <+58>: retq
Target 0: (bitcoind) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10000)
  * frame #0: 0x0000000102445d8e libdb_cxx-4.8.dylib`__lock_get_lk_max_locks + 53
    frame #1: 0x00000001023c4afa libdb_cxx-4.8.dylib`DbEnv::get_lk_max_locks(unsigned int*) + 46
    frame #2: 0x0000000100458dbf bitcoind`BerkeleyEnvironment::Open(this=<unavailable>, retry=<unavailable>) at db.cpp:195:12 [opt]
    frame #3: 0x000000010045abab bitcoind`BerkeleyBatch::VerifyEnvironment(file_path=<unavailable>, errorStr="") at db.cpp:417:15 [opt]
    frame #4: 0x00000001004fb295 bitcoind`CWallet::Verify(chain=0x0000000102a02990, location=0x00007ffeefbfed50, salvage_wallet=false, error_string="", warning_string=<unavailable>) at wallet.cpp:3972:14 [opt]
    frame #5: 0x0000000100477628 bitcoind`VerifyWallets(chain=0x0000000102a02990, wallet_files=<unavailable>) at load.cpp:56:31 [opt]
    frame #6: 0x00000001000727b9 bitcoind`AppInitMain(interfaces=<unavailable>) at init.cpp:1321:22 [opt]
    frame #7: 0x0000000100004592 bitcoind`AppInit(argc=<unavailable>, argv=0x00007ffeefbff418) at bitcoind.cpp:171:16 [opt]
    frame #8: 0x0000000100004042 bitcoind`main(argc=<unavailable>, argv=<unavailable>) at bitcoind.cpp:201:13 [opt]
    frame #9: 0x00007fff7edfc3d5 libdyld.dylib`start + 1
    frame #10: 0x00007fff7edfc3d5 libdyld.dylib`start + 1
(lldb)

The crash does not happen when using depends. It also does not happen with a more recent BDB version using --with-incompatible-bdb (this requires uninstalling berkeley-db@4).

bitcoin/bitcoin

Answer questions jingzhehu

I run into the same problems as Sjors - make check producing errors

fatal error: in "psbt_wallet_tests/psbt_updater_test": memory access violation at address: 0x02800000: no mapping at fault address

After I did brew uninstall berkeley-db; brew reinstall berkeley-db4 and ./autogen.sh && ./configure --without-gui && make -j16, the make check -j16 part passed without error.

useful!
source:https://uonfu.com/
Github User Rank List