bitcoin: bitcoin-qt crashes if it can't listen on the port it wants to
I created new folders ~/.bitcoin2 and ~/.bitcoin3, then ran bitcoin-qt using both of them as data directories.
The first one ran fine:
qt/bitcoin-qt -datadir=/home/chris/.bitcoin2
I left the first one running. The second one crashed in various ways:
$ qt/bitcoin-qt -datadir=/home/chris/.bitcoin3
Error: Unable to bind to 0.0.0.0:8333 on this computer. Bitcoin Core is probably already running.
Error: Failed to listen on any port. Use -listen=0 if you want this.
Segmentation fault
$ qt/bitcoin-qt -datadir=/home/chris/.bitcoin3
Error: Unable to bind to 0.0.0.0:8333 on this computer. Bitcoin Core is probably already running.
Error: Failed to listen on any port. Use -listen=0 if you want this.
free(): double free detected in tcache 2
Aborted
$ qt/bitcoin-qt -datadir=/home/chris/.bitcoin3
Error: Unable to bind to 0.0.0.0:8333 on this computer. Bitcoin Core is probably already running.
Error: Failed to listen on any port. Use -listen=0 if you want this.
corrupted size vs. prev_size in fastbins
Aborted
I would expect it to complain about the unavailable port, but not to crash in such random ways.
This is bitcoin built against git tag v24.0rc2
.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23 (23 by maintainers)
The crash doesn’t happen if I use
bitcoind
. I get a clean shutdown withbitcoind
:How about this?
That combination of options seems to provoke the crash for me every time, whereas specifying a random unused rpcport allows it to run without crashing: