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