When HashLookupStage::readIndicesFromRecordStore() reads from the buffer the number of stored records, instead of 1 it gets back value 2^56 which leads to OOM on attempting to allocated a vector of this huge size.
Found by: https://jira.mongodb.org/browse/BF-24912