zmq: shutdown/abort when configured with invalid addresses #15198

issue fanquake opened this issue on January 18, 2019
  1. fanquake commented at 9:08 AM on January 18, 2019: member

    Follow up from #15168.

    If a single zmq notification is configured with an invalid address, initialisation fails, however bitcoind continues running:

    src/bitcoind -zmqpubhashblock=tcp://127.0.0.1::28332 -debug=zmq
    ....
    2019-01-18T08:55:28Z BerkeleyEnvironment::Open: LogDir=/Users/xxx/Library/Application Support/Bitcoin/wallets/database ErrorFile=/Users/xxx/Library/Application Support/Bitcoin/wallets/db.log
    2019-01-18T08:55:28Z zmq: version 4.2.5
    2019-01-18T08:55:28Z zmq: Initialize notification interface
    2019-01-18T08:55:28Z zmq: Outbound message high water mark for pubhashblock at tcp://127.0.0.1::28332 is 1000
    2019-01-18T08:55:28Z zmq: Error: Failed to bind address, errno=Operation not supported by device
    2019-01-18T08:55:28Z zmq: Notifier pubhashblock failed (address = tcp://127.0.0.1::28332)
    2019-01-18T08:55:28Z zmq: Shutdown notification interface
    2019-01-18T08:55:28Z zmq: Shutdown notifier pubhashblock at tcp://127.0.0.1::28332
    2019-01-18T08:55:28Z Cache configuration:
    

    If two zmq notifications are passed, and the first address is invalid, bitcoind aborts:

    src/bitcoind -zmqpubhashblock=tcp://127.0.0.1::28332 -zmqpubrawtx=tcp://127.0.0.1:28332 -debug=zmq
    ......
    2019-01-18T09:01:13Z BerkeleyEnvironment::Open: LogDir=/Users/xxx/Library/Application Support/Bitcoin/wallets/database ErrorFile=/Users/xxx/Library/Application Support/Bitcoin/wallets/db.log
    2019-01-18T09:01:13Z zmq: version 4.2.5
    2019-01-18T09:01:13Z zmq: Initialize notification interface
    2019-01-18T09:01:13Z zmq: Outbound message high water mark for pubhashblock at tcp://127.0.0.1::28332 is 1000
    2019-01-18T09:01:13Z zmq: Error: Failed to bind address, errno=Operation not supported by device
    2019-01-18T09:01:13Z zmq: Notifier pubhashblock failed (address = tcp://127.0.0.1::28332)
    2019-01-18T09:01:13Z zmq: Shutdown notification interface
    2019-01-18T09:01:13Z zmq: Shutdown notifier pubhashblock at tcp://127.0.0.1::28332
    2019-01-18T09:01:13Z zmq: Shutdown notifier pubrawtx at tcp://127.0.0.1:28332
    Assertion failed: (psocket), function Shutdown, file zmq/zmqpublishnotifier.cpp, line 114.
    Abort trap: 6
    
  2. fanquake added the label RPC/REST/ZMQ on Jan 18, 2019
  3. fanquake cross-referenced this on Jan 18, 2019 from issue Bitcoin Core fails assertion and aborts when zmq enabled on MacOS Mojave by joaojoyce
  4. promag commented at 7:18 PM on January 28, 2019: member

    And the expected behavior is to exit cleanly with some status error?

  5. mruddy commented at 7:51 PM on April 21, 2020: contributor

    i noticed this while testing #18309. specifically, i noticed that zmq initialization would fail when one of the addresses is ipv6 since we don't set the ZMQ_IPV6 socket option: http://api.zeromq.org/4-0:zmq-setsockopt

  6. n-thumann commented at 9:47 PM on May 24, 2021: contributor

    This should be fixed in #17445 and can be closed, doesn't it?

  7. fanquake closed this on May 25, 2021

  8. n-thumann cross-referenced this on May 26, 2021 from issue zmq: Add support to listen on IPv6 addresses by n-thumann
  9. laanwj referenced this in commit b05d3e76e7 on Sep 9, 2021
  10. bitcoin locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:54 UTC