Assertion failed: (nMaxInbound > 0), function AcceptConnection, file net.cpp, line 973. #9007

issue paveljanik openend this issue on October 24, 2016
  1. paveljanik commented at 4:36 pm on October 24, 2016: contributor

    Current bitcoin-master on testnet, maxconnections=8 in the config file. Running in VM that doesn’t have public IP and is not reachable from the Internet.

    Wait until you have 8 peers.

    0telnet localhost 18333
    

    It will result in:

    0Assertion failed: (nMaxInbound > 0), function AcceptConnection, file net.cpp, line 973.
    

    First found in #8996, but can be reproduced on master.

  2. laanwj added the label P2P on Oct 24, 2016
  3. laanwj added this to the milestone 0.13.1 on Oct 24, 2016
  4. sipa commented at 4:54 pm on October 24, 2016: member
    Can it also be reproduced in 0.13.1rc2?
  5. laanwj commented at 5:00 pm on October 24, 2016: member
    Can you try setting maxconnections=9 instead and see if it still happens? (I think it shouldn’t because MAX_OUTBOUND_CONNECTIONS=8, MAX_FEELER_CONNECTIONS=1)
  6. paveljanik commented at 5:13 pm on October 24, 2016: contributor
    I think it should be 10, because the assert is >0. Confirmed by testing.
  7. paveljanik commented at 5:14 pm on October 24, 2016: contributor

    Extended original report:

    0nMaxConnections = 8
    1nMaxFeeler = 1
    2nMaxOutbound = 8
    3nMaxInbound = -1
    4Assertion failed: (nMaxInbound > 0), function AcceptConnection, file net.cpp, line 979.
    
  8. MarcoFalke added the label Priority Medium on Oct 24, 2016
  9. MarcoFalke added the label Priority High on Oct 24, 2016
  10. MarcoFalke removed the label Priority Medium on Oct 24, 2016
  11. MarcoFalke added the label Priority Medium on Oct 24, 2016
  12. MarcoFalke removed the label Priority High on Oct 24, 2016
  13. laanwj closed this on Oct 25, 2016

  14. EthanHeilman commented at 3:13 pm on October 25, 2016: contributor

    The core assumption I made which is being violated is that nMaxConnections is less than 9.

    I’m against just removing this assert since it seems confusing and unexpected to allow a max number integer to be negative. Instead I propose that the code not assume nMaxConnections will always be greater than 9 by scaling nMaxOutbound with nMaxConnections such that nMaxInbound is not negative.

  15. laanwj commented at 5:36 pm on October 25, 2016: member
    @EthanHeilman I agree with doing that for 0.14, the logic (and input checking! this error should have been flagged in init.cpp not while the node is running with an assert) could definitely be improved, but for 0.13.1 we don’t have the time to do a more measured solution.
  16. DrahtBot locked this on Sep 8, 2021


paveljanik sipa laanwj EthanHeilman

Labels
P2P

Milestone
0.13.1


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: 2024-10-05 07:12 UTC

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