darkrenaissance / darkfi

Anonymous. Uncensored. Sovereign.

Home Page:https://dark.fi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

binaries panic on macos

nogira opened this issue · comments

darkfid & ircd not working (likely others, but haven't tested). does work on linux vm though. using latest rust version

output of running darkfid binary:

15:39:08 [INFO] Creating path to database: /Users/home/.config/darkfi
15:39:08 [INFO] Opened connection at path sqlite:///Users/home/.config/darkfi/darkfid_wallet.db
15:39:08 [INFO] Initializing wallet database
15:39:08 [INFO] Main keypair: 14Sx3QqYqAtRjp2LLiwyiu6zoC47B63UsCycZNwnYFtKtdVhfm
15:39:40 [INFO] Registering block sync P2P protocols...
15:39:40 [INFO] Starting JSON-RPC server
15:39:40 [INFO] Starting sync P2P network
15:39:40 [WARN] Skipping seed sync process since no seeds are configured.
15:39:40 [INFO] Starting blockchain sync...
15:39:40 [WARN] Node is not connected to other nodes
15:39:40 [INFO] Blockchain synced!
15:39:40 [INFO] Not configured for accepting incoming connections.
15:39:40 [INFO] Not starting consensus P2P network
15:39:40 [INFO] JSON-RPC listener bound to tcp://127.0.0.1:8340
HERE
15:39:40 [INFO] Starting 8 outbound connection slots.
15:39:40 [WARN] Hosts address pool is empty. Retrying connect slot #0
15:39:40 [WARN] Hosts address pool is empty. Retrying connect slot #1
15:39:40 [WARN] Hosts address pool is empty. Retrying connect slot #2
15:39:40 [WARN] Hosts address pool is empty. Retrying connect slot #3
15:39:40 [WARN] Hosts address pool is empty. Retrying connect slot #4
15:39:40 [WARN] Hosts address pool is empty. Retrying connect slot #5
15:39:40 [WARN] Hosts address pool is empty. Retrying connect slot #6
15:39:40 [WARN] Hosts address pool is empty. Retrying connect slot #7
Error: AsyncChannelRecvError("receiving from an empty and closed channel")

in comparison, the linux VM keeps cycling over [WARN] Hosts address pool is empty. Retrying connect slot #{x} without ever giving Error: AsyncChannelRecvError("receiving from an empty and closed channel")

it seems this error message is from the async-channel crate code in darkfi/bin/darkfid/src/main.rs, though the error itself is possibly coming from the ctrlc-async crate code which interacts with the async-channel code

i made a minimally reproducible example here with a fix, but it doesn't seem this fix can be readily applied elsewhere in the code particularly easily (i.e. where shutdown var gets passed into raft.run()/raft.start() e.g. darkfi/bin/tau/taud/src/main.rs): https://github.com/nogira/ctrlc-async-bug

and even though this seemed to fix darkfid initially, running drk ping sometimes fails while darkfid is running

ircd seems to be fixed (unaware of any bugs as of yet)

any ideas on another way to fix this AsyncChannelRecvError("receiving from an empty and closed channel") error?

note: i am currently on a beta version of macos, so there is always the possibility this is a macos bug

i am also seeing this on macos 12.1 when running ircd

fixed