Map insert makes the application crash
Summary
Around the superblock the wallet crashes because of map insertion.
Steps to reproduce
Open the wallet around the superblock wait until it fully synced and restart it.
Expected behavior
The application must work normal
Problematic behavior
The application crashes
Crown-core environment info
Reproduced on Ubuntu 16.04
Crown-core application info
(The wallet version, like v0.12.4.1; link to the pipeline/build if possible.)
Possible fixes
Remove positional iterator.
The crash is caused by this code fragment (masternode-budget.cpp)
if (isOldVote)
m_obsoleteVotes.insert(found, std::make_pair(masternodeHash, vote));
else
...
Here found
is the iterator of another map (not m_obsoluteVotes
but m_votes
) and if the value of that iterator is m_votes.end()
then the wallet crashes.
It happens almost always when wallet already has cached vote values and then it receives the old votes again.
Tasks left
- Superblock generation regresstion testing
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information