Handshake between nodes is more than just sending version/verack messages back and forth. It consists of sending and receiving a couple of other messages that I'd like to call "preference" messages which are telling the other peer the settings and preferences your node prefers.
These messages include
feefilter,
sendcmpct and
sendheaders. They need to be handled during handshake and the receiver needs to remember these preferences so that it can communicate with its peer the way it requests.
For example when receiving
sendcmpct "preference" message, the receiver has to remember to send any new blocks to this peer as compact blocks as defined by BIP-152.
Assuming
this is the code, the reason why it is crashing here is because it lacks the message parsing capability not because the other node responded to
getheaders with
sendcmpct. It probably got caught in the parsing queue and crashed there.
I say "queue" because these messages aren't necessarily sent one by one, they can be received in one payload (eg. verack + ping +
feefilter +
sendcmpct) and the receiver has to handle the entire payload with multiple messages.