Fixes ZMQ startup with bad arguments. #7621

pull mrbandrews wants to merge 1 commits into bitcoin:master from mrbandrews:ba-fix-zmq changing 2 files +1 −1
  1. mrbandrews commented at 6:45 PM on February 29, 2016: contributor

    Fixes #7496.

    A bad ZMQ argument caused the code to create a socket but not destroy it and later in the shutdown code, zmq_destroy() hangs as a result.

    This also removes a gratuitous call to the Shutdown method of ZMQNotificationInterface; the code calls the destructor right after returning, which calls Shutdown.

  2. Fixes ZMQ startup with bad arguments. 0040118959
  3. in src/zmq/zmqnotificationinterface.cpp:None in 0040118959
      99 | @@ -100,7 +100,6 @@ bool CZMQNotificationInterface::Initialize()
     100 |  
     101 |      if (i!=notifiers.end())
     102 |      {
     103 | -        Shutdown();
    


    promag commented at 10:32 PM on February 29, 2016:

    NACK, this implies that the caller calls Shutdown() if return is false.


    laanwj commented at 1:33 PM on March 1, 2016:

    The destructor will call it, which will be invoked automatically whether Initialize returns false or not.


    promag commented at 7:01 PM on March 1, 2016:

    @laanwj assuming you delete the object.. nevertheless Initialize() should be all or nothing. Removing the call to Shutdown() leaves the notification interface partially initialised.


    mrbandrews commented at 10:10 PM on March 1, 2016:

    @promag CreateWithArguments deletes the object if initialization fails


    promag commented at 12:23 AM on March 2, 2016:

    @mrbandrews @laanwj right, forgot Initialize() is protected. I take it back.


    laanwj commented at 12:57 PM on March 3, 2016:

    assuming you delete the object

    Sure. But well if not that's a memory leak, and thus a bug in self.

  4. jonasschnelli added the label Refactoring on Mar 1, 2016
  5. laanwj commented at 1:35 PM on March 1, 2016: member

    utACK 0040118

  6. promag commented at 12:24 AM on March 2, 2016: member

    utACK 0040118.

  7. sipa commented at 5:17 AM on March 5, 2016: member

    utACK

  8. laanwj merged this on Mar 15, 2016
  9. laanwj closed this on Mar 15, 2016

  10. laanwj referenced this in commit a6a860796a on Mar 15, 2016
  11. dcousens commented at 11:49 PM on March 15, 2016: contributor

    utACK 0040118

  12. zkbot referenced this in commit 36df5a92f8 on Feb 9, 2017
  13. zkbot referenced this in commit dd8b38316f on Feb 9, 2017
  14. zkbot referenced this in commit 253c610783 on Feb 9, 2017
  15. DrahtBot locked this on Sep 8, 2021

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-04-22 06:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me