net: only delete CConnman if it's been created #8715

pull theuni wants to merge 1 commits into bitcoin:master from theuni:fix-connman-shutdown changing 2 files +1 −1
  1. theuni commented at 6:58 PM on September 13, 2016: member

    This fixes a possible shutdown crash. Thanks to @morcos for reporting.

    In the case of (for example) an already-running bitcoind, the shutdown sequence begins before CConnman has been created, leading to a null-pointer dereference when g_connman->Stop() is called.

  2. jonasschnelli added the label P2P on Sep 13, 2016
  3. sipa commented at 9:29 PM on September 13, 2016: member

    Concept ACK, but wouldn't it be easier to invoke CConnman::Stop() from CConnman::~CConnman, and then call g_connman.reset() at the time you'd stop?

  4. theuni commented at 9:36 PM on September 13, 2016: member

    As discussed on IRC, yes. This is over-engineered as-is, for future threading scenarios that may not ever happen. I'll make that change.

  5. net: only delete CConnman if it's been created
    In the case of (for example) an already-running bitcoind, the shutdown sequence
    begins before CConnman has been created, leading to a null-pointer dereference
    when g_connman->Stop() is called.
    
    Instead, Just let the CConnman dtor take care of stopping.
    36fa01f217
  6. theuni force-pushed on Sep 14, 2016
  7. theuni commented at 2:45 AM on September 14, 2016: member

    Replaced with the simpler version.

  8. laanwj merged this on Sep 14, 2016
  9. laanwj closed this on Sep 14, 2016

  10. laanwj referenced this in commit 881d7eaf29 on Sep 14, 2016
  11. random-zebra referenced this in commit 777638e7bc on Aug 27, 2020
  12. DrahtBot locked this on Sep 8, 2021
Contributors
Labels

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-18 15:15 UTC

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