after brew update/upgrade today i have, in deterministic way:
recompiling it is ok but, running i have a broken node, fatal crash at
dbenv->set_lg_bsize(0x10000);
Thread 1: EXC_BAD_ACCESS (code=1, address=0x10000)
after brew update/upgrade today i have, in deterministic way:
recompiling it is ok but, running i have a broken node, fatal crash at
dbenv->set_lg_bsize(0x10000);
Thread 1: EXC_BAD_ACCESS (code=1, address=0x10000)
You need to provide more information. Which dependencies did you update / upgrade (bdb)? Are you building the v0.20.1 tag, or the 0.20 branch? Which version of macOS are you building/running on? In fact, could you just supply all of the information that was asked for in the issue template.
I am with macOS Catalina, Version 10.15.7
$ uname -a
Darwin isidoros-MacBook-Pro.local 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64
$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Xcode: Version 12.4 (12D4e)
Bitcoin:
v0.20.17ff64311bee570874c4f0dfa18f518552188df08$ make distclean
$ ./autogen.sh
$ ./configure --without-gui --enable-debug
…
Options used to compile and link:
with wallet = yes
with gui / qt = no
with zmq = yes
with test = yes
with fuzz = no
with bench = yes
with upnp = yes
use asm = yes
sanitizers =
debug enabled = yes
gprof enabled = no
werror = no
target os = darwin
build os = darwin19.6.0
CC = gcc
CFLAGS = -g -O2
CPPFLAGS = -DDEBUG -DDEBUG_LOCKORDER -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -I/usr/local/opt/berkeley-db@4/include -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0
CXX = g++ -std=c++11
CXXFLAGS = -O0 -g3 -ftrapv -Wstack-protector -fstack-protector-all -Wall -Wextra -Wformat -Wvla -Wswitch -Wformat-security -Wthread-safety-analysis -Wrange-loop-analysis -Wredundant-decls -Wunused-variable -Wdate-time -Wno-unused-parameter -Wno-self-assign -Wno-unused-local-typedef -Wno-deprecated-register -Wno-implicit-fallthrough
LDFLAGS = -pthread -Wl,-bind_at_load -Wl,-headerpad_max_install_names -Wl,-dead_strip -Wl,-dead_strip_dylibs
ARFLAGS = cr
$ make
$ cd src
$ ./bitcoind
2021-03-31T19:37:21Z Bitcoin Core version v0.20.1 (debug build)
2021-03-31T19:37:21Z Assuming ancestors of block 0000000000000000000f2adce67e49b0b6bdeb9de8b7c3d7e93b21e7fc1e819d have valid signatures.
2021-03-31T19:37:21Z Setting nMinimumChainWork=00000000000000000000000000000000000000000e1ab5ec9348e9f4b8eb8154
2021-03-31T19:37:21Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
2021-03-31T19:37:21Z Using RdRand as an additional entropy source
2021-03-31T19:37:21Z Default data directory /Users/isghe/Library/Application Support/Bitcoin
2021-03-31T19:37:21Z Using data directory /Users/isghe/Library/Application Support/Bitcoin
2021-03-31T19:37:21Z Config file: /Users/isghe/Library/Application Support/Bitcoin/bitcoin.conf (not found, skipping)
2021-03-31T19:37:21Z Using at most 125 automatic connections (283 file descriptors available)
2021-03-31T19:37:21Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
2021-03-31T19:37:21Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2021-03-31T19:37:21Z Script verification uses 7 additional threads
2021-03-31T19:37:21Z scheduler thread start
2021-03-31T19:37:21Z HTTP: creating work queue of depth 16
2021-03-31T19:37:21Z No rpcpassword set - using random cookie authentication.
2021-03-31T19:37:21Z Generated RPC authentication cookie /Users/isghe/Library/Application Support/Bitcoin/.cookie
2021-03-31T19:37:21Z HTTP: starting 4 worker threads
2021-03-31T19:37:21Z Using wallet directory /Users/isghe/Library/Application Support/Bitcoin/wallets
2021-03-31T19:37:21Z init message: Verifying wallet(s)...
2021-03-31T19:37:21Z Using BerkeleyDB version Berkeley DB 4.8.30: (April 9, 2010)
2021-03-31T19:37:21Z Using wallet /Users/isghe/Library/Application Support/Bitcoin/wallets
2021-03-31T19:37:21Z BerkeleyEnvironment::Open: LogDir=/Users/isghe/Library/Application Support/Bitcoin/wallets/database ErrorFile=/Users/isghe/Library/Application Support/Bitcoin/wallets/db.log
Segmentation fault: 11
I never had this kind of problem. And I am runninq bitcoind on my Mac since 2013, always with the datadir in an USB external HD.
The point is, it looks like "brew update", or some other update in Xcode broke something.
It would be interesting to understand if someone else, in my analogous configuration, has the same problem or not.
Thanks, Isidoro
If you suspect your recent brew update to have caused this issue, try running brew list -lt. It prints a list of formulae and casks, including their modification date. Which formulae have been updated during last update and does reverting them (if they are even related to Bitcoin) helps?
SOLVED! (soon the details)
The problem was "Berkeley DB 4.8.30". So I uninstalled it with:
$ brew uninstall berkeley-db@4
and I followed the instructions in #19411 with @fanquake's workaround:
CFLAGS="-Wno-error=implicit-function-declaration" ./contrib/install_db4.sh .
so I configured bitcoin, with suggested in the output of ./contrib/install_db4.sh
When compiling bitcoind, run `./configure` in the following way:
export BDB_PREFIX='/Users/isghe/development/cryptocoin/bitcoin/db4'
./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...
so, in my case:
$ export BDB_PREFIX='/Users/isghe/development/cryptocoin/bitcoin/db4'
$ ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" --without-gui --enable-debug
and now bitcoin is alive again ;-)
Thanks, Isidoro
however, just a clarification (very small detail): despite uninstalling "Berkeley DB 4.8.30" in "brew", after configuration, it is shown in CPPFLAGS:
-I/usr/local/opt/berkeley-db@4/include
but now, on my mac, I no longer have the /usr/local/opt/berkeley-db@4/ folder
So it's a small bug on configurator
:-p
from my point of view, the problem is SOLVED.
maybe we need to emphasize this solution in doc/build-osx.md
Thanks,
Isidoro