Bitcoin-Qt: exception in CInv::GetCommand() when using -onlynet="IPv6" #1625

issue Diapolo opened this issue on July 23, 2012
  1. Diapolo commented at 5:41 PM on July 23, 2012: none

    I'm using current master with own modifications to the code as a testing playground (I did not change any IPv6 networking code), just pull #1615 is somehow net-related.

    When doing a full blockchain download with -onlynet="IPv6", I get the following exception:

    <pre> ************************ EXCEPTION: St12out_of_range CInv::GetCommand() : type=3 unknown type C:\Users\Diapolo\bitcoin.Qt\release\bitcoin-qt.exe in ProcessMessages() </pre>

    Part of the log before shows always this:

    <pre> received: inv (73 bytes) </pre>

    Afterwards this is always the same:

    <pre> ProcessMessage(inv, 73 bytes) FAILED </pre>

    Most messages show inv, 73 bytes, only some are with different sizes (4285 bytes, 325 bytes and 37 bytes). The first occurence is at block height=48000, then height=64688, height=84688, height=116771 ... (~25 exceptions until the chain is up to date).

    When doing the same initial blockchain download (just wallet.dat in datadir) with -onlynet="IPv4" not a single of these exceptions occurs, which leads me to believe there is a glitch in the IPv6 code or a strange behaving IPv6 node I'm connected to.

  2. Diapolo commented at 9:36 PM on August 1, 2012: none

    Just as a remainder: Perhaps ban such misbehaving nodes!

  3. Diapolo commented at 10:38 AM on August 24, 2012: none

    @sipa Do you think this does need further checks or something? If no just close this issue.

  4. laanwj commented at 8:47 AM on February 24, 2014: member

    Does this cause a crash of the program or just an exception after which it will continue on as normal?

    If the first this is a serious issue, otherwise it is just a matter of a client getting booted for invalid messages and we can close this.

  5. Diapolo commented at 10:27 AM on February 24, 2014: none

    At the time of my test it was a hard crash...

  6. laanwj commented at 11:48 AM on February 24, 2014: member

    Ok, I'm going to try to reproduce this.

  7. Diapolo commented at 12:19 PM on February 24, 2014: none

    I couldn't reproduce this during a testnet IBD. But as far as I remember it just happend on main net.

  8. laanwj commented at 12:29 PM on February 24, 2014: member

    Hm. I don't think it matters on which network. How did you try to reproduce, did you try to manually inject the packet?

  9. Diapolo commented at 12:39 PM on February 24, 2014: none

    No I just startet with an empty block-db to start an IBD.

  10. laanwj commented at 1:19 PM on February 24, 2014: member

    inv type=3 is a "Filtered block" by the way. It is a relatively new type introduced in the bloom filter extension. Not sure if it already was the case back then.

    I've tried sending invalid 'inv' packets to my local bitcoin client using pynode, this does result in the following message on stderr and debug.log:

    ************************
    EXCEPTION: St12out_of_range       
    CInv::GetCommand() : type=4 unknown type       
    bitcoin in ProcessMessages()    
    

    No crash though. It logs the exception and carries on as normal.

  11. laanwj closed this on Feb 24, 2014

  12. suprnurd referenced this in commit e22453c902 on Dec 5, 2017
  13. MarcoFalke 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-21 18:16 UTC

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